LEGISLATING MORALITY is tricky business, and the New York legislature undertook the task too casually when it passed that anticontraceptive law the Supreme Court, held unconstitutional the other day. The law made it a crime to sell or give contraceptives to anyone under the age of 16. But New York law permitted 14-year-old brides were barred from obtaining legally items 16-year-olds could obtain. The mindlessness of it simply underlines the kind of difficulties that arise when a state tries to intervene in the most personal and private affairs of its citizens. There were similar situations; the law also forbade doctors or parents from giving contraceptives to minor patients or children.

Of course, it was not just these peculiarties of the New York law that the Supreme Court held unconsitional. That law also made it a crime for anyone other than a licensed pharmacist to sell or distribute contraceptives and barred the display or advertising of them. those provisions fell, too, as the Court expanded somewhat the individual's right to privacy and elaborated on the First AMendment protection it is now giving to commercial advertising.

A clear majority of the Court is now committed to the proposition that government can legislate about childbearing and conception only if it can demonstrate a compelling need for the restrictions it imposes. No such need existed for the bar against the sale of contraceptives by anyone other than pharmacists, and that bar clearly made it more difficult - and certainly less private - for some people to obtain them.

But the Court is still not certain about how to handle this subject when minors are involved. Given the four different views expressed by the seven Justices who voted to strike down that part of the New York law, there may still be room for states to try to write legislation. That brings us back to the business of legislating morals. The purpose of the New York law was to discourage sexual activity by minors, but no one could produce evidence that the law achieved anything other than additional exposure to venereal disease and pregnancy. That suggests to us that this whole area is one in which government can do little that is useful and had best leave the creation of moral standards to parents, churches and teachers.

Indeed, the Court dismissed almost out of hand the argument that all advertising of contraceptives could be made illegal because any advertising of them would encourage sexual activity among the young. While the Justices left open the door to laws barring ads that incite illicit sexual conduct, they said that ads like those in this case - which merely stated what was available and how much it cost - could not be barred merely because they might be offensive or embarrassing to some people. In the long run, the Court may well accept limitations on the way products like these are advertised and on the places, where those ads appear. But it is clear now, if it wasn't before, that truthful advertising ' called "commerical speech" by the Justices - has won a considerable degree of First Amendment protection and that the right of privacy, recognized by the Court only a few years ago, has become a powerful tool for limiting the ways in which government can interfere in the personal affairs of its citizens.