My argument is that it is now legislators who are the moral guardians and they encode their moral values into laws for the rest of us to follow.
Gone are the influences of religion on moral codes, we have the law now.
Hence modern morals are codified into laws, enforced by the police.
Hence the question: If something is legal, can it also be imoral?
I think that there is a huge overlap between what is legal, and what is moral. Indeed, you'd expect that to be the case, given that the law is to some extent a codification of basic societal, er, moral norms.
But there are things that are moral that are not legal, and I think there are things that are, vice versa, legal but not moral.
That could be difficult to argue, because a lot of morality is subjective, but if we took something that could be generally regarded as immoral, let us say, killing someone, it isn't that hard to find situations where it is legal to kill someone - religionists, after all, consider abortion immoral, yet it is legal. On the other side of the coin, there are plenty of examples of acts that are claimed as moral, but which are illegal. A notable case of that working in favour of the "moral" side was Clive Ponting's acquittal in 1985 on official secrets charges. As far as he was concerned, there was no doubt that he had broken the law, and he was expecting to be convicted. However, the jury presumably took account of his defence - essentially, a "public interest" defence, and thus moral - and acquitted him.
You said that you thought "legislators...are the moral guardians and they encode their moral values into laws for the rest of us to follow", and I agree, to an extent. I certainly think that they
consider themselves moral guardians, and there does seem to me an increasing willingness to resort to legislation to solve problems, rather than looking for more integrated, perhaps morally-based solutions. I'm thinking about things like drugs laws - to me, drug addiction is more a moral issue than a criminal one, for example - or the rush to drink-free zones, ASBOs and so on to try and legally enforce the kind of restrictions on behaviour that a reasonably functioning society
should be able to establish by habit and repute. These things are often dressed up as moral ones - "to make old ladies feel safe at night" - but they're essentially about trying to crowbar behaviour by brute force rather than subtlety and guile
And I think that "we know what's best for you" message we are hearing quite a lot of at the moment is probably driving the "treat 'em like kids, and they'll behave like kids" truism along very nicely - nobody likes being fingerwagged at, and the general response in adults is much the same as in kids, a thumbing - albeit metaphorical - of the nose the moment Authority's back is turned. But when we subscribe to moral codes, we tend to do it much more as a choice we've made, not one that is inflicted on us. And I think that has a bearing on how likely we are to stick to the rules...
So yes, something that is legal
can be immoral. To some people. Some of the time.