In a large sauce pan or dutch oven, heat olive oil over medium high heat.
Add in onion and saute until translucent. Add in garlic for a quick minute until fragrant.
Add in the rest of the ingredients, from the pasta to the red pepper flakes, and stir until everything is combined.
Cover with lid and bring to boil.
Once boiling, lower heat to medium-low and cook for 15-20 minutes, stirring occasionally, until most of the liquid is absorbed. There can be a little liquid left as it will thicken as it continues to sit, but you don't want it to be soup-y.
Turn off the heat and add in bag of spinach. Stir and cover with lid. Let sit for 5 minutes. Stir and at this time most of the liquid should be absorbed.
Top with freshly grated parmesan cheese.