...Except for all of the social programs that are literally just legislated charity?
What do you think TANF (welfare) and SNAP (food stamps) and Medicare and Medicaid and Social Security are...? Heck, what do you think schools and libraries are? Do you think those are all morally wrong as well?
You might as well say you can't legislate a military, or that you can't legislate courts to enforce contracts...