To me it looked like he already accepted the possibility of being lonely at school so...
The second girl is her best friend sure, but it's undeniable he saved her and her thinking that he did it to see her underwear is just plain stupid writing
He also had the perfect opportunity to explain...