Homosociality
For example, a close relationship between two men (such as George and Lennie in Of Mice and Men (and indeed most of the characters in that book) would be a homosocial relationship. It can apply to single sex schools, prisons, monasteries, but also to simple friendships.