And the morality behind any piece of legislation derives from the moral philosophy of the legislators and their constituents.
The notion that only moral systems based on materialism are permitted to influence or direct legislation is unfair, silly and philosophically unsound.
Materialism is a 'morality,' too--and for practical purposes, it is the morality of the Libertarians.