If you are referencing Roe v Wade you are mistaken.
They did not say abortions are illegal, they said that basically the 10th Amendment to the Constitution ("The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people."). Based upon this original intent, the Constitution of the United States gives the Federal Government no authority whatsoever to involve itself in the issue of abortion. Thus the States have the power to govern abortions.
Part of the above was copied from:
The Voter's Self Defense System