Honestly I don't think the friend is too right on this one because he doesn't know the situation Nao had just been in.
The hug was completely justified and pretty normal for that situation I'd say. Kouki felt sorry that he hadn't been vigilant (even if he's not at fault for anything).
The problem is Kouki can't really just say "she had just been groped and I felt at fault for it" because he doesn't know if Nao would be comfortable with that info being known.
I wish it wasn't the case, but people very often are not comfortable having others know that they've been molested, even in relatively minor cases of it like seen here.