Because luffy helped heal her from her traumatic past and Boa helped him extensively in the fight to save his brother a pefson most important for him. Sure this should make them good friends but I personally enjoy luffy's chaotic morals compared to Boa's evil leaning but still reasonable demeanor. They wouldn't be a perfect couple but you have to admit they would be a great power couple.
Imo Luffy x vivi is the best match as I see them as complete equal. The moment she taught Laffy to bow his head and use his mind instead of resulting to violence might be the best moment pretimeskip. We've even see him do this again to Boa Hancock meaning he's learned more from Vivi than another female. Luffy treating her like a complete equal and give her a two piece and a biscuit before helping her save her country. Vivi is without a doubt the most eligible woman for Luffy. If they had children she would raise luffys child to be kind hearted and good while they would also inherit Luffys chaotic nature.
Laffy x vivi is without a doubt the best ending and oda knows it making vivi one year younger than luffy and honorable unofficial strawhat. She also understands Luffy aswell as anybody in her crew and has the respect of his crew and grandfather. It also raises an interesting dynamic with dragon who is normally against nobles. While Rebecca is an interesting runner up and nami a great consolation prize nobody has hooks in luffy as much as vivi who Luffy was actually depressed to leave. Unlike Rebecca, shirahoshi and Boa. Zero even said if you wanted her so much you should have taken her by force.