Well depending on how tightly you define "murder" I'd say that it's always immoral but it hasn't always been illegal.
If you killed someone and took their stuff after they were declared
outlaws does that count as murder or as the state subcontracting capital punishment? What about tribal societies that place no penalties on a person for anything they may do to a member of the "out group"?
"Illegal" is just a category of actions that will get you punished by whatever passes for government in the society in question. That's it. It doesn't matter how absolute the concept or how tight the definition is. It's illegal because there's a law and you get punished for it. If the law is repealed, it's no longer illegal. It's legality has nothing to do with it's morality either. If murder was legalized it wouldn't suddenly become moral because those are two independent questions. Slavery was legal in much of the world for quite a long time and is as easily defined as murder but it wasn't moral just because you were allowed to do it.
The morality of an action has nothing to do with whether or not the government will punish you for doing it.