If taxes were about financing the government there would just be one tax called the-cost-of-government-tax and that's it. There would be no need to tax everything you do, and at different rates and on some days but not others, but when the moon is full on tuesday you pay double except if you lived on 72nd street during 2008...
Taxes are about control, about influence, and about corruption. The loopholes are there becasue someone put them there, they are not hidden. The tax-code is so complex because someone made it that complex, someone doesn't want it to be easy.