Totally incorrect. Its generally accepted that legality and morality are not coextensive, but that's different than legality and morality being orthogonal. Legality and morality are closely correlated, in that societies tend to make illegal actions they consider immoral. Thus, while it's possible for something to be illegal that society does not consider immoral, it's generally not the case.
There are lots of laws that are not considered immoral on their own, but are enforced due to practical constraints on determining risk. Driving a car without a license is not an immoral act if someone posses the training and skill and carefully applies these. However, determining the individual case risk becomes practically impossible and thus we make driving without a license illegal. The same goes for construction permits, business and contractual law, etc.
Similarly, things with very high risk of long term negative effects to the society or the individual are made illegal due to the risk and not due to the immorality of the event itself, such as our drug laws.
I'm using "illegal" here in the narrow sense to refer to violations of criminal law, rather than civil ordinances. Breaking into a computer and stealing files isn't a civil offense like driving without a license, it's a criminal offense that's illegal because society considers it immoral.
Re: drug laws, people do consider drug use and dealing to be immoral.
Or stated differently, the illegality of act has no bearing on it's ethical or moral status.