Illegal actions become a loophole when the means of enforcing the law is far too weak to catch most attempts at breaking them.
Imagine if the only punishment for theft was having to pay back 200% of what you stole. As long as you don't get caught half the time, it is profitable to steal. That would be both something which is illegal and also a loop hole in the law.