Opinions ???

What is everyone’s opinion on getting married before the baby arrives ?? My boyfriend and I have been together for 5 years & just recently found out we’re pregnant. My parents are suggesting that we get married soon but I’ve always wondered why? Like are there real benefits in marrying before the baby or is it just a moral type of thing?