Judge Learned Hand (not the Supreme Court, but often quoted; I'm sure partly for the name):
"Any one may so arrange his affairs that his taxes shall be as low as possible; he is not bound to choose that pattern which will best pay the Treasury; there is not even a patriotic duty to increase one's taxes" (Gregory v. Helvering, 1934)
"Over and over again courts have said that there is nothing sinister in so arranging one's affairs as to keep taxes as low as possible. Everybody does so, rich or poor; and all do right, for nobody owes any public duty to pay more than the law demands: taxes are enforced exactions, not voluntary contributions" (Commissioner v. Newman, 1947).
People can lower their taxes by buying alternative fuel vehicles, renovating historic properties, donating to charities, etc. Those laws are meant to encourage that behavior. But somebody using them to lower their taxes is engaged in tax avoidance. Is that wrong?
Many states have business tax laws that aren't as noble-minded but are meant to encourage businesses to hire people (e.g., no income tax) or operate from those states (e.g., favorable treatment of inventory). Is it wrong to take advantage of those tax laws?
In my opinion, the alternative minimum tax ( https://www.irs.gov/taxtopics/tc556 ) is proof that the United States has given up on creating a system where tax deductions and tax credits always give a reasonable outcome.