The Prime Minister has said the Scottish Government “should follow the law” on single-sex spaces, amid a high-profile tribunal surrounding a trans doctor using a female changing room.