Preheat oven to 400° F. Wash sweet potatoes and use a fork to poke a few holes in them. Bake 45 minutes to 1 hour until soft (check using a toothpick or fork, there should be no resistance). Remove from oven and set aside for 10 minutes to cool.
Bring a pot of water to a boil. Cook the spaghetti according to the package. Reserve up to a cup of pasta water, then drain and set aside.
Heat olive oil in a large skillet over medium heat. Add garlic and cook for 1 minute. Add in red pepper and cook for another 2-3 minutes. Lower the heat.
Scoop the soft part of the potato out of the skin and add to skillet. Pour in a bit of milk and stir until it combines with the potato. Keep adding the milk little by little until it is all absorbed into the sauce. Season with salt and pepper.
Add pasta and spinach to skillet. Use the reserved pasta water to thin out the sauce. Add a little at a time and stir, like with the milk, until it reaches desired consistency.
Serve with a sprinkle of grated parmesan and enjoy!