John Swinney’s most senior civil servant has hit back as suggestions the usage of single-sex spaces within the Scottish Government does not meet legal requirements.