Add the chopped bacon to a large-bottom skillet and turn the heat to medium.
Cook, stirring occasionally, until the bacon is crispy, about 5 minutes.
Turn off the heat and place the bacon on a paper towel-lined plate.
Drain the skillet, leaving about 2 tablespoons of bacon fat in the pan.
Reheat the pan over medium-low heat and add the diced onion.
Cook for about 5 minutes, stirring frequently, until the onion softens and turns translucent.
Stir in the minced garlic and butter, cooking for 2 minutes until fragrant and melted.
Pour in the chicken broth and stir well, scraping any browned bits from the bottom of the pan.
Add the spaghetti pasta (break in half if needed), and turn the heat to high.
Bring to a boil, then reduce to a gentle simmer.
Cook for about 10 minutes, stirring often, until the pasta is al dente and most of the liquid is absorbed.
Lower the heat and stir in the chopped spinach.
Cook until wilted, about 5 minutes, then add red pepper flakes.
Return the reserved bacon to the pan and mix well.
Heat just until the bacon is warmed through, about 2 minutes.
Serve immediately topped with grated parmesan.