In a large pot over medium heat, bring about 2 quarts lightly salted water to a boil. Add spaghetti and cook for about 1 to 2 minutes less than package's directions. Rinse under cold, running water and drain well. Set aside.
In small, heavy-bottomed pot, arrange chicken breasts in a single layer. Add quartered onions, smashed garlic cloves, bay leaf, salt, peppercorns, and enough water to cover.
Bring to a boil, skimming scum that floats on top. Lower heat, cover, and cook in a barely a simmer for about 10 to 15 minutes or until thermometer inserted in the thickest part of chicken reads 165 F.
With a slotted spoon, remove chicken from pot and allow to cool to touch. Coarsely shred chicken and keep warm.
Strain liquid using a fine mesh sieve. Discard aromatics and reserve 1 cup of the broth.
In a wide skillet over medium heat, melt butter.
Add onions and cook until softened.
Add diced tomatoes and cook, mashing with the back of the spoon.
Add diced green chilies.
Add the reserved broth and cream of mushroom soup. Stir until combined and bring to a boil.
Add spaghetti, chicken, and 1 cup of the cheese. Gently stir until combined and cook for about 1 to 2 minutes or just until heated through.
Transfer mixture to a lightly-greased baking dish and top with the remaining 1 cup cheese.
Cover tightly with foil and bake in a 375 F oven for about 20 to 25 minutes or until hot and bubbly. Remove foil and continue to bake for about 1 to 2 minutes or until lightly browned.
Remove from heat and serve hot.