The short answer to this is that the Roe v. Wade case made abortion a constitutional right in the United States.
In the time before this decision was handed down, there were many states in which abortion was simply illegal. In Roe, the Supreme Court overturned such laws. The Court did so on the basis of the right to privacy. Of course, the Constitution does not explicitly say that people have a right to privacy. However, the Supreme Court ruled that there are various parts of the Constitution that imply that people do have such a right.
Having held that people have a right to privacy, the Supreme Court held that the right to have an abortion was part of this right to privacy. The Court did recognize that this right is not absolute. It held that the states have an interest in protecting human life. Therefore, it held that the farther a pregnancy goes, the more states can regulate abortion. In the first trimester, states cannot regulate abortion. In the second trimester, they can regulate it more. In the third trimester, when the fetus is much more viable outside the womb, they can prohibit abortion altogether.