In a large pot, cook pasta according to package directions. Before draining, set aside 3/4 cup of the cooking water in a heat-proof medium bowl.
Heat a large skillet over medium heat. Add onion and bacon; sauté until onion softens, about 3 minutes.
Add tomatoes and sauté for 2 minutes. Add cooked spaghetti and beans; cook for 1 minute.
Stir spinach into pot, cover and reduce heat to low. Cook until spinach wilts, 1 to 2 minutes.
Add egg yolks to bowl with reserved cooking water and whisk well; add to pot along with cheese and pepper. Using tongs, toss mixture until coated and cook for 1 minute.
Notes
Recipe source: July/August edition of Clean Eating Magazine