
I mean it's not like they're hanging out with "pure" (friendly) intentions, so it's understandable that he might've panicked in the moment and just tried to cover it up on instinct. It can be easy to forget not everyone might assume something when that something in question is, indeed, true.
There's probably something to be said about how he doesn't want his school circle of friends to start including Hiruma too, or else he'll have to start acting differently around him.
... But most of all tbh he was just caught off guard and didn't think things through before saying it. That just happens sometimes

Going to just use this to reply to everyone asking why/doesn’t understand, but I think that since the president’s spent a long time building up his image to the rest of the school, he instinctively defends against anything that could even possibly jeopardize it, even unintentionally. I agree with what w_iju said, and want to add my own take on it.
as someone who’s absolutely pants at social relations irl, it’s easier to push things/people who might change how others see you away and deny them, especially the longer you’ve been trying to stay as this image of yourself that other people perceive you to be (in his case, the “student body president”) It gets harder over time to be honest about your interests, to the people around you and to yourself. The people walking up could have been anyone that he knew, and he still would have pushed away our frog, even if it was someone who knew both of them, or someone who didn’t even know him.
Anyways this is just my take on this
maybe it’s a japanese culture thing, but why is it so embarrassing to be seen with someone FROM THE SAME SCHOOL? like bro what. isn’t the usual response would be “yeah we just happened to talk and got along somehow haha” or something along the lines of it? maybe im being to stereotypical sorry but a lot of misunderstandings happen just because of this issue in soooo many bl. besides if it’s a girl and a boy, i’d understand the feeling of not wanting people to assume you’re a couple just cause you’re together a lot. but you are both boysssare boys not even allowed to talk to each other and have a friend outside of their social circle now ngl i really hate it when a conflict happens cause of this like pls come up with a different and more angsty conflict no more “haha we don’t really know each other” typa shit