The law exists to help rulers govern society, and should help those in that society to live peaceably. The law should allow people to live and let live. It should encourage people to get along with one another.
However, it is more and more the case that the law is dabbling in questions which are beyond its proper brief and, in doing so, it makes the job of getting along with one another more difficult. One area where this is quite evident is the way the law deals with sexuality and gender.