In the US I think they are primarily for keeping of order - but since people like morality, even if they don't agree on what it is, morality gets incorporated into our laws in many ways.
If you study the history of laws, there are times and places (even today) where they are more equal, but even in Rome of Jesus' day, it was pretty clear they weren't.