Why does vanitas look almost exactly like sora?
Prior to the events of Birth By Sleep, there was a point in time where Sora's and Ventus' hearts connected
After a brief discussion, Ventus's heart connects with Sora's, mending his broken heart and allowing Ven to stay alive until he someday becomes strong enough to repair the damage by himself
This connection, as Tetsuya Nomura states, is the reason why Vanitas resembles Sora. This resemblance wouldn't only reflect on Sora - if anybody had connected to Ventus' heart like Sora had, Vanitas would have resembled them as well
In an interview with Tetsuya Nomura as well as various novelizations of the game, it is revealed that this similarity is due to Sora's heart connecting with Ventus near the beginning of the game, and had anyone else connected with Ventus's heart, Vanitas would look like that person