I think your logic is failing there, the fact that something is legal doesn't make it ethical straightaway.
You can do unethical things using legal loopholes without it being necessarily illegal.
You can do unethical things using legal loopholes without it being necessarily illegal.