Federal court decisions once ruled that Social Security was unconstitutional. Both as a trust fund and as insurance. When the Supreme Court reversed the lower court rulings on technicalities, it refused to rule on the constitutionality of the Social Security Act (Steward Machine Co. v. Davis 301 US 548, and in Helvering v. Davis 301 US 619, both decisions were made on the same day) and left the larger decision for a later case. It is valid as an excise tax on government welfare privileges.
They ruled (Helvering at page 645) that “We find it unnecessary to make a choice between the arguments, and so leave the question open.” They have still not ruled on the larger question.
The year after the Social Security Act was passed, the U.S. Supreme Court in Ashwander v. Tennessee Valley Authority, 297 U.S. 288 (1936) set rules on which cases it will consider:
“The Court will not pass upon the constitutionality of a statute at the instance of one who has availed himself of its benefits.”
Which is why Social Security constitutionality has never been ruled on.