The most common cause of slimy pasta is when you cook the pasta in pot that is too small.
When you cook the pasta in a too small of a pot the pot doesn't hold enough water and then the pasta boils in the starch and it's released at concentrated levels.
That then leads to slimy pasta.
So next time try using a bigger pot and add more water.
Just don't add too much water or it will boil over but make sure the pasta is covered with water and then any excess water leftover after cooking the pasta you can drain out with a strainer.
Adding salt to the pasta water also helps prevent slimy pasta.
The salt added to the pasta also helps the pasta bring forth it's natural flavors.
Another cause of slimy past is overcooking the pasta.
When you overcook the pasta it can become slimy as well.