I pretty much don't care about discussing Yamato's character itself here since it has nothing to do with nakama arguments, but isn't it pretty obvious what the intent was?
A core theme in this arc is identity. The main villain wanted to become Joyboy, a person alive in the past, and inherit his will. Yamato wants to become Oden and inherit his will. The conflict they have is with their oni lineage and believing they must be this person to carry out their dreams. Onis have a bad relationship with humans so maybe that's why they choose to take on another identity?
Regardless, this reveal with Luffy now connects him to their dilemma. How he handles being the confirmed Joyboy inheritor affects those two. If Luffy denies it and embraces who he is, that then makes Yamato learn to accept just being Kaido's daughter and not let her lineage shackle her from who she wants to be. The same message shown with Sanji, Jinbe, Robin, etc. in this arc.