There are a LOT of rules which are codification of things that should not apply in all circumstances, but which it's too complicated to define the rule to the fine-grained level that would make it universal. Lax enforcement is one way to allow flex in rules that are best if they're directional guidance rather than clear specifications.
Speed limits on public roads, for instance - they're insanely low for good conditions (clear, dry, good visibility, competent driver in a well-functioning car). They're somewhat low for decent conditions, they're probably too high in the worst possible case.
There's a lot of the world that works this way - there's enough variance across participants and conditions that there is literally no legible coherent rule which maximizes any goal - it's all a compromise among averages.
One of the tests for noticing a broken system is asking "What would happen if everyone did that?" about breaking some rule. This is especially useful when you're considering breaking it yourself for short-term gain. If the answer is "the system would need to change in a way that's better for me", then it's often justified.
Another perspective is seeing how often the rules are broken by other people. In almost every system, rule-breakers are gaining unfair advantage due to insufficient enforcement. This should sometimes occur, because otherwise too many resources are getting spent on fighting it. But in a stag hunt it's stupidity, not altruism, to attempt teamwork when everyone else is getting rabbits.
Often costs are disproportionally higher to those trying to cooperate. Reputation as a rule-follower is a valuable thing to have, and people who break rules all the time have a low marginal cost to break the next one too. Same goes for internal image as a moral or rule-following person. At least in legal matters, money has the same problem; if you already don't have any, it cannot be taken away. Freedom can be taken away, but that's very expensive for society.
In worst cases, following the rule becomes a low status, or at least not-default. When I bought a train ticket in Berlin, a friend asked why I did so, as the probability of getting caught is low, and you can just talk your way out of the fine anyway. I wasn't sure about Berlin, but at least in Helsinki it's cheaper to not buy the ticket and pay the occasional fine when you get caught by inspectors. Many people do this. I still hang onto paying for my tickets, often by walking instead of taking a tram, destroying the value instead of paying the probabilistic fine. All because of the shame of getting caught for rule breaking. But if that shame goes away, there's no point in paying.
Many examples are not that clear. My favourite example is gray area tax planning.
In tax law, the economic-substance doctrine goes something like this: in transactions and business arrangements lacking a substantial purpose, other than a tax benefit, the legal form can be reinterpreted to an adequately-taxed one. Almost all jurisdictions have a rule like this, and it's exceptionally important in international tax law. A typical case goes like this: States A and B have a tax treaty that sets withholding tax to 15%. However, they both have a treaty with state C that has zero withholding tax. A corporation having branches in both A and B would like to transfer the profits through C, but simply opening an office there won't suffice, as the doctrine means it would get ignored. Instead of simply paying the 15% tax, any profit-maximizing entity would first check if they can create some business in state C that looks like legitimate business. It doesn't matter much even if it's not profitable, as long as it's losing less money than the taxes would be. After enough activity, it's hard to tell if anything illegal is going on; the only crime is the intent.
The doctrine described above pushes companies to be illegible. Even if the intent of an operation is to reduce tax burden, it has to be framed in another way. While not universally agreed, my image of corporations is they're amoral profit-maximizers of varying time horizons. I strive for that in my own taxable activities too. Since the utility of money is logarithmic, which means tax fraud is not sensible in the first place, as the money goes to approximately zero if caught. As the taxation professionals keep insisting, the loopholes are left there for a reason, to be used. The legislators are not stupid, or at least they have access to professionals who know how these things work, and could remove the loopholes if desired. You're not supposed to pay too much tax, as it hurts growth, if not anything else.
Does the advantage from illegibility extend to not paying for public transport tickets? Only to the extent where you'll be let go without a fine if you claim you forgot to buy a ticket. Such leniency makes me less happy to pay for it.
But while stealing bikes is effectively decriminalized, that still crosses the line for most people, even those who don't think twice about not getting a bus ticket. And optimizing your taxes in legal ways is seen as a duty of a diligent person. The two main differences are what I already mentioned. First, if everyone was stealing bikes, people would spend more money in locks and such, pure security overhead. (Or maybe we could get cheap rentable city bikes instead? Both can happen.) Second, stealing someone's bike puts the cost directly onto a single person, but taxation and ticket cases diffuse the harms, so the Copenhagen Interpretation of Ethics says you're less responsible.
The tax system looks like this because it has been gamed against harder and more systematically than others. The competitive pressure, Moloch, has already eaten all values other than surviving, i.e. profit.
Not all systems should be that robust against adverse action. Positive sum trade is good, and more value is more value. But when the majority is on board with the sacrifice, you'll have to pay as well, in morals or resources.