The house system is a traditional feature of boarding schools in England. So I can’t see how it could be a malicious metaphor against gender fluidity. Moreover, as the series progresses the sorting hat critiques being divided and urges the students to see beyond their house colours and unite against Voldemort.