Neil Gray told MSPs it was up to health boards to ensure compliance on single-sex spaces but the opposition says ministers are failing on women’s safety.