Second royal in unpleasant house, a single-sex one (9)
I believe the answer is:
monastery
'house a single-sex one' is the definition.
(where monks live without any women)
I can't explain the remainder of the clue.
Can you help me to learn more?
(Other definitions for monastery that I've seen before include "Residence of religious community" , "Religious house" , "Religious establishment" , "Community of monks" , "Where brothers gather" .)