Legislation is written by LOBBYISTS.
The good news, I guess, is that government has become such an enormous “industry” these days that the bills passed by Congress are getting increasingly convoluted to the point of being incoherent.
Very good point however, laws that are so incoherent make it much easier for them to be applied unevenly. We're seeing that right now. I suspect the trial balloon for this was IRS tax code.