I think there are a few reasons why people get married.
1. They actually want to be with somebody forever.
Now I never understood why people need to get married for this. They can be together regardless. Divorce is always an option so you can't claim that it's commitment.
2. Being pressured.
The pressure could come from peers, parents or even the significant other. Getting married because somebody else wants you too is a really bad idea.
3. Just to check it off of their to do list.
Some people think you have to do certain things in life. Things like always aiming for a higher job position, owning your own house, having kids and yes, getting married. This has been ingrained in us since birth and is expected of us. Some people don't consider that you don't have to follow this path to be content with your life.
4. To get a Green Card.
Nothing to add here.
5. Desperation.
Some people just can't handle being alone and are willing to settle with anyone. They'll fool themselves into thinking they actually love somebody and are willing to go through hell just to keep them. This will lead to a toxic relationship.
6.A project.
This is more of a relationship thing but I'll include this anyway. I noticed that women in particular will pick what you can call a bad boy and try to mold him into something she approves of. After a while they'll realize that their partner will never change and will move onto the next guy.