I am always amused/annoyed whenever I hear the phrase "You can't legislate morality." That statement is one of the biggest lies around for one reason:
Laws define what is right and wrong for a society.
When a law is made, so is a moral judgment. Murder is wrong. Theft is wrong. Fraud is wrong. Driving while intoxicated is wrong...etc. Society has determined these are not right and has passed laws that proclaim this and also how the society will deal with those who break these laws. Even my town's proclamations about no dogs in the park is a judgment about whether or not dogs' activities in the park mesh with other people's activities in the park (more probably, its a moral judgment saying "people have been jerks with their dogs in the park).
Also, take a look at our Constitution, particularly the Bill of Rights. It declares that certain freedoms are good. The right to free speech, for worship, to assemble, to bear arms, to not be forced to incriminate oneself -- these are protected under the highest laws of our land because our forefathers agreed these were GOOD (a moral judgment). Our laws even proclaim these rights are above the rights of the government.
When I was a teenager, there was a huge push for tougher drunk driving laws. Whether or not these laws reflected society's increasing concern regarding the dangers of drunk driving, or whether the tougher laws inspired the feelings of the people, it is difficult to tell. Probably both. We are seeing the same process with the "Don't Text and Drive" campaigns now. (God help us that we even need this!)
More people were against abortion when a woman's right to have one was proclaimed by the Supreme Court than years later. Because it is legal, it has become more accepted. Even people who state that they believe its murder often maintain that a woman has a right to do it -- which in and of itself is a contradiction. Under certain circumstances, one person may have the right to take the life of another human being, but murder is when someone takes the life of another person with malice and without having the right to do so.
Morality is legislated all the time. In fact, Aristotle (I believe) stated that the application of morality to an individual is called "Ethics." The application of morality for the good of society is called "Politics." I paraphrase, because I can't find the quote.
You cannot separate law and morality. They are intertwined. And you CAN legislate morality. Except for some administrative laws, legislating is when a governing body making a moral judgment. Really, you can't NOT legislate morality, if you are legislating at all.