An Ulster Unionist Party (UUP) motion proposing that transgender prisoners be held in facilities according to their biological sex has failed.