By providing rules and regulations for what citizens can and cannot do, laws play a big part in defining the cultural expectations of a society. The World Justice Project states that the rule of law protects rights, limits corruption, and handles civil and criminal infractions.
In theory, the laws created within a society reflect the needs and values of that society and will work for the best interests of the citizens, but laws can also strongly influence the society that created them. The New York Times cites the Brown v. Board of Education case of 1954 as proof that a law can change society, saying that without the school integration reforms during the Civil Rights Movement, schools would be very different today. Because desegregation laws were put into place, people began to view discrimination differently. These changes may have bolstered white supremacy advocates initially, but probably paved the way for greater tolerance in the long run.
Similarly, the recent legislation regarding marriage equality legislation continues to change the role and perception of homosexuality in society. Nevertheless, studies by ProCon.org indicate that resistance to same-sex marriage has not stopped, even in societies that legally endorse it. This shows how difficult it can be to determine how exactly a law affects society, especially when the law is recent.