Yes, the eternal virginity of Mary is a “doctrine” without a purpose.
It has no effect on believing on Jesus for salvation.
If it is SO important, why does scripture imply that Mary DID have other children?
No one taking the scripture at face value would see a perpetual virginity state for Mary.
For the same reason that the Bible gives lots of details on things that likewise have nothing to do with salvation. The Bible is a book of faith, but also poetry and history. If you went to Wikipedia for information about, say, when Bob Dylan wrote “It Ain’t Me Babe,” you’d also find out when he was born, where he lived, what influenced his work, and a host of other information not germane to “It Ain’t Me Babe.”