No gender was established. At the very most we can speculate on its survival strategy. As far as anybody knew, it was the last of its kind; perhaps its actions would reflect a strategy of continuing the species? In Star Trek, that's possible even between random species (of biped humanoids), and the creature might have been aware of that, depending a bit on its level of sapience.
It had paired with the male Crater after killing his wife - signs of a female trying to breed? Yet it had not bred with Crater. Prospects down on the planet might not have been good for that. After gaining access to Kirk's ship by killing several males, at least one of whom it tried to woo in the guise of a female, it settled in - and tried to woo Uhura in the guise of a male, and McCoy in the guise of a female. Does this mean that statistically, it was female, and Uhura was just food or competition like Nancy Crater? Or is this just an artifact of it being whatever its victims wanted to see, and Kirk's crew mostly consisted of heterosexual men?
Beyond all that... No telling.
Timo Saloniemi