None of this complexity is from trying to plug tax loopholes. Most of it is from politicians wanting to name things.
For example, for decades Canada has had a "personal amount" tax credit -- for arcane reasons, rather than saying "the first $X of income isn't taxed", the lowest tax bracket starts at $0 but there's a non-refundable credit equal to the lowest tax rate times $X. Then a politician came along and said "we should increase the personal amount so that people can earn more money without paying taxes... but we don't want to decrease taxes on the top 1%". So now we have a "personal amount" which depends on your income. Similarly, in BC we have the "BC Tax Reduction" which is an extra tax credit given to people with incomes between (roughly) $22k and $36k.
Both of those examples could have simply been implemented as tax brackets but voters get far more excited about a "Tax Reduction" than they do about a new tax bracket.