Political parties have been banned from taking part in a Pride event in Scotland following the UK Supreme Court's ruling on the legal definition of a woman.