Start by boiling a large pot of salted water. Add the pasta and cook according to package instructions until al dente. Reserve 1/2 cup of pasta water, then drain the pasta using a colander.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and sauté for about 1 minute, until fragrant but not burned.
Add the fresh spinach to the skillet and sauté until wilted, about 3-4 minutes (if using frozen spinach, heat until warmed through).
Lower the heat and pour in the heavy cream. Stir well and allow to simmer for 2-3 minutes.
Gradually add the mozzarella cheese and Parmesan cheese to the cream mixture, stirring continuously until the cheeses are fully melted and the sauce is smooth.
Season the sauce with salt, pepper, and red pepper flakes, if using.
Add the cooked pasta to the skillet and toss to coat the pasta with the cheese sauce. If the sauce is too thick, add a little reserved pasta water until the desired consistency is reached.
Serve the cheesy garlic spinach pasta immediately and enjoy!