When Sakura was first introduced to us, she had a huge crush on Sasuke. She would do anything to get his attention, even if it meant competing with other girls. It was clear that Sasuke and the naruto merch had no interest in her and considered her a nuisance.
Even before leaving to join Orochimaru and become strong enough to be able to kill his brother Itachi, the presence of Sakura waiting for him at the gates of the village was for him a problem and a nuisance.
After few years when they didn’t see each other, Sakura’s feeling for Sasuke didn’t change at all, however, Sasuke had incredibly changed. He had become stronger, but also darker and more evil.
Nevertheless, Sakura still kept faith in Sasuke even after he joined the Akatsuki and tried to kill her on the bridge where he killed Danzo Shimura. And even after the fight vs Kaguya Otsutsuki and decided to take control of the village by force, Sakura still had faith that Sasuke could come back to her.
In the end, Sasuke didn’t succeed in beating Naruto to become the Hokage of Konoha and decided to repent himself. After been excluded by the village, Sasuke decided to travel the world to find redemption, however, just before leaving, Sakura went to say her goodbyes to him and showing him that she still believes in him and will be waiting for his return.
This situation touched Sasuke to the heart and while grabbed the food that she had prepared for him, he touched her forehead the same way that his brother used to do when he was a kid, showing her his new affection and gratitude towards her.
But could Sasuke have married another person like Ino? Well, it’s difficult to answer this question. For sure, Ino would have loved to become Sasuke’s wife, however, Ino didn’t share as much connections with him compared to Sakura.
And what about Karin? Well Karin is definitely in love with Sasuke but he never considered her more than a means to an end. He needed her for his plans of revenge against his brother and Konoha, but that’s all.
This globally explains why did Sasuke marry Sakura. With Naruto, she was one of the only person that always kept faith in him and loved him no matter what. It was then normal for the author to offer the fans this ending as loyalty and faith on other people should be rewarded.