It's quite noticeable in Star Trek TOS and TNG that superior officers tend to call officers of lower ranks 'Mister': for example, Kirk would regularly refer to his officers as 'Mister Sulu' or 'Mister Scott'. Picard often refers to his officers in a similar way (e.g. 'Mr LaForge' or 'Mr Worf'). This isn't limited just to captains, but to higher-ranking officers generally; even Riker has referred to Worf as 'Mister Worf' on several occasions I seem to recall. Yet, when referring to female officers, they are typically addressed either by their first name (informally) or, more formally in the format [Rank] [surname] e.g. 'Lieutenant Uhura'. I'm just wondering whether there is any reason (in or out of universe) why male officers are referred to as 'mister [surname]' regularly but female officers aren't referred to as 'miss/mrs [surname]'.
Memory Alpha has an article detailing occasions in various series (including ST:TOS and ST:TNG) and movies (notably Star Trek: The Motion Picture, and Star Trek: The Wrath of Khan) where men and women are addressed as "Mister," including in and out of Starfleet. The term "Mister" could be used to denote respect, when coupled with the addressee's given name, or disrespect when used without a name.
Notable women Starfleet personnel addressed as such include "Mr. Saavik" (Wrath of Khan), "Mr. Martine" (ST:TOS "Balance of Terror").
Starfleet Captains are generally not addressed as "Mister," although subordinates may otherwise be so addressed on board a Starfleet vessel. As an example of non-Starfleet uses of the term of address include the Federation President, who is addressed as "Mister President" in Star Trek: The Voyage Home.
Compare with Starfleet regulations designating superior officers be addressed as "Sir" regardless of gender (e.g. in ST:TNG, "The First Duty" Wesley Crusher addresses femal Rear Admiral Brand as "Sir"; in ST:VOY, "Caretaker" Captain Janeway expresses dislike for being addressed as "Sir" (among other things) and prefers "Captain").
The practice is an armed forces (mainly naval) one, where a senior officer will refer to a subordinate officer as "Mister " rather than by their rank. Presumably in Starfleet they have carried on this tradition in some form. Referring to female officers as "Mister" would sound a bit odd even in the future so perhaps there is a female equivalent that was never shown or perhaps they only use the "Mister" tradition for male officers (and androids).
Because whilst 'Mr' applies to all men (with the debatable exception of 'Master', which even in the U.K. isn't commonly encountered anymore, and more specific titles such as 'Sir', 'Lord', and whatever else), electing to address a woman with 'Miss' or 'Mrs' requires knowledge of their marital status, which I suppose would be beyond reasonable expectation considering the numbers of female officers involved. As someone else stated, 'Ms' (in my opinion a truly horrid alternative anyway) was not sufficiently commonly used, at least during the time of the Original Series, to do anything other than distract viewers.
Speaking strictly about Star Trek TOS, remember, this was 1966 and Gene Roddenberry had a tough time even getting the series approved. Referring to women as "Mister" probably wouldn't have gone over too well. I'm not sure if "Ms" was widely accepted back then and they probably thought using Miss or Mrs would be a distraction from the storyline.
I think they did a good job of respectfully including women in roles that were not traditional at the time, in a way that would not appear preachy. And given the number of different script writers they had, they were fairly consistent with the terminology.