The cotton gin made slavery profitable and more widespread.
The framers of the Constitution compromised on slavery believing that it wound die out of its own economic weight.
The cotton gin changed the economic factors. Large numbers of slaves could be engaged in growing cotton while only a few were needed to process the cotton. This made growing cotton using slave labour hugely economically profitable.
Also before the cotton gin only long stem cotton could be profitably harvested. The cotton balls had to be stripped of the cotton by hand. Only the long stem variety could be worked by hand. This variety only grew in cooler climates like Virginia.
After the cotton gin short stem cotton could be profitably harvested as the machine removed the cotton fibers from the cotton balls. Short stem cotton could be grown in warmer climates like Mississippi and Alabama. Slave plantations growing cotton spread across the entire south. The wealth produced by these plantations created a demand for more and more slave labour.
The cotton gin had the unforeseen consequences of spreading and increasing slavery across the south.