First, the legislature often decides that raising or lowering specific taxes is a good way to encourage some behavior or other (i.e. mortgage tax deductions or extra taxes on cigarettes). Most of these are actually pretty justifiable individually, but eventually you end up with too many exceptions and special cases for any nonspecialist to keep them all in their head.
Second, there's a huge body of caselaw and regulatory rulings that crop up around the actual tax code. Dozens of courts somewhat haphazardly decide that this weird edge case counts as income, but that weird case doesn't. Again, almost all of these are pretty reasonable taken in isolation, but you end up with a swiss cheese of arbitrary and contradictory rules.
Finally, wealthy entities will inevitably try to game the system. They will try to find a few well-intentioned but poorly thought out edge cases and alter their finances to try and intentionally fit a huge percentage of their income into them. By the time this happens, it's often very difficult to fix without hurting the innocent bystanders that the edge cases were put in place for in the first place.
Wealthy individuals and companies do lobby for favorable tax provisions, and politicians do sometimes pass laws specifically to benefit those entities. But the reality isn't that simple. International tax law is an emergent phenomenon, and it's really only going to bend to systemic incentive changes.
The reason politics is full of vapid stupidity is that powerful entities want it that way. If the population wasn't distracted by guns, abortion, and gay sex they might actually be paying attention to issues that matter.
A business can't tell their landlord that they owe no rent because they are "unprofitable" ? Why then do we accept this excuse from the businesses who benefit the most from our public systems.