The common theme in all religions of stature is that loving kindness is the true path to happiness for humankind.
Practicing loving kindness needs development and training in humans, and so all religions incorporate guidance to their adherents as to how to accomplish the discipline necessary to develop an enduring practice of loving kindness. To promulgate these behaviors there is an obvious progression, especially in societies dominated by a single religion, to incorporating that guidance into the rules and laws of that society.
The root problem with legislating the path to loving kindness is that it is an internal journey, accomplished by individual humans for themselves, and cannot be externally imposed. So the whole endeavor becomes a completely self-defeating strategy as the freedoms of the humans subjugated thusly are curtailed and replaced with intimidation and oppression – the opposite of loving kindness! Spiritual traditions can offer a path to happiness but they cannot force anyone down that path; faced with this reality religious governments invariably conclude that their only option for non-conforming people is to imprison, main or kill them, otherwise they lose the credibility of their attempt to legislate their path.
Compounding the error, spiritual “laws” do not provide good guidance on the practicalities of running a developed society with millions of citizens. Inevitably, religious societies bring in the services of commercial minds to accomplish those tasks. Thus is born the moralist-capitalist state, of which there are many examples today, not least of which include Iran, China and the USA. This is doubly ineffectual because the commercial interest is not the same as the social interest, and now you have moralists restraining freedom at the same time as you have commercialists restraining the growth of wealth (the commercial mind is concerned primarily with the concentration of wealth).
For humans to develop their innate faculties for loving kindness they must live in a free society that is run for the benefit of its citizens. If we are to give ourselves the government we deserve, we MUST take PERSONAL responsibility for our own path to loving kindness. This insight is incorporated in the Standards of LIFE, and determines the absolute requirement for secular government.