Kashimashi: Girl Meets Girl/WMG

Hazumu got turned into a female because Hazumu had already identified as one.
For the most part Hazumu is much happier as a female. The fact that it takes so little time for Hazumu to adjust to the new identity and that Hazumu is very naturally feminine is further evidence of Hazumu identifying as female. Finally, the fact that Yasuna can see Hazumu even when Hazumu was in a male body is extremely likely to be linked to Hazumu's gender identity.

Finally when the aliens reconstructed Hazumu's body, they have enough Magic From Technology to draw directly from Hazumu's spirit. Since Hazumu's spirit identified itself as female, the Magic From Technology reconstructed her body as such.

Ayuki is in love with Tomari
You know all those times she was talking about liking someone but not chasing after them and such?

Ayuki is in love with Yasuna
She is extremely sweet to Yasuna in the manga when.
 * And that's a shame, since it would have been nice to see.

Tomari had a slight crush on Yasuna
Ever so slightly, in the manga. Most likely she didn't even notice

Yasuna had a slight crush on Tomari
Yasuna swoons over Tomari a few times, especially when Tomari behaves more "girly", so who knows what would have happened if Tomari had decided to do that more often. It sure does explain somewhat why Tomari and Yasuna were still rather nice to each other, despite them competing over the same girl's affection.