The definite article that is used is based on the words grammatical gender, which has nothing to do with the real world gender. 'κορίτσι' is a neuter word (grammatically speaking) and thus the definite article used is the singular neuter nominative 'το'.
It's an interesting question. You'd think that κορίτσι and αγόρι would be η and ο respectively, but instead, they're το. It's actually similar in German where Mädchen is Das instead of Die. In my mind, I sort of just interpret it as children not actually being or acting like the gender that they're born with. Like an adult would see a child as a child regardless of gender, but would see a woman as a female and a man as a male. It's kinda hard to explain because when I'm speaking German, I feel like I think a bit differently, but when I'm using Greek, this is how I think.