Virtually all laws involve "legislating morality." When people use this phrase they often really just mean "I want laws to back my version of morality, not yours."
Just as people shouldn’t be forced to send their children to church, they shouldn’t be forced to send their children to a state-approved organization for secular education and training.