Pasta that is left out overnight is not considered by the USDA as safe to eat.
However most times pasta left out overnight or for a few hours is perfectly safe to eat as long as it hasn't actually spoiled.
But if in doubt throw it out and don't risk your health.
Pasta left out overnight is safe to eat in most cases as long as it does not smell bad or have a bad taste to it.
I've personally left pasta out overnight and then reheated the pasta the next morning and ate it and I haven't gotten sick from it.
Although the USDA says it's not safe to eat the pasta left out overnight or longer than a few hours it's really is okay to eat pasta and some foods left out overnight or for 2 hours or more.
The USDA has guidelines that food establishments have to abide by for health reasons.
Just smell the pasta, taste the pasta or look and see if the pasta is really slimy or has mold in it.
If it does not have any of those bad smells, bad tastes or has no mold or slimy feeling to it then it's usually safe to eat.
Cooked food sitting at room temperature is in what the USDA calls the “Danger Zone,” which is between 40°F and 140°F. In this range of temperatures, bacteria grows rapidly and the food can become unsafe to eat, so it should only be left out no more than two hours.