Legally speaking, since it is against the law, it must be against the legal relationship regulated and protected by the law. Even if copyright or patent rights are infringed, it is hard to say that it does not violate moral norms if it is subjectively malicious. Similarly, even in some criminal cases, many criminals are morally sympathetic, and some behaviors may be praised instead. However, the law will not show mercy. For example, if a person has a rough road, it is too late to draw his sword.
In addition, the scope of legal constraints is far narrower than moral constraints. Many behaviors that violate ethics are not against the law.