Nicola Sturgeon has been slammed by MSPs for refusing to answer a "basic question" about gender identity.