It's legal, yes, but you can't make a jump to moral so easily.
I don't think it's necessarily immoral either, but morality depends on much more - what the end results are, who is affected, what kind of effect, etc. Morality doesn't exist in the vacuum of an isolated decision.