Judges do not create new law. They interpret existing law and decide if a potentially new use case can be considered to be covered under existing law. If so, they make a ruling to that effect, and depending on jurisdiction and other factors, that ruling may become precedent that other courts can/will follow. If not, they dismiss the case, and it's up to the legislature to make a new law governing this use case, if they so choose.
Having said that, I agree that judges aren't idiots, and they can often spot when someone is trying to be creative in order to circumvent existing law. The IRS also has pretty broad latitude in determining what falls under existing tax law and exactly how, and the courts take a dim view of people who are trying to evade taxes.