raven's right dude and as a trans person im here to give you the basics
biological sex is what you're born as - whether that's male, female, intersex, or anything i mighta missed out. this is to do with chromosomes and a lot of other stuff.
gender is a lot more complicated and despite being agender (uh, genderless - to use a pokemon metaphor, magnemite. except im not an OP robot flying thing) myself i don't have a full understanding yet so if sylar sees this and can gimme a heads up on this i'd appreciate it. anyway its a lot to do with how you feel - whats going on in your heart and mind, what you are. Who you are as a person. It's got a little to do with roles and such as well RE: society, but the definition is different in places based on the person. it's highly tied to the person rather than how others try to define them.
anyway rambling aside, as an idea i think it could possibly work. however, if i remember right, there are some values when it coming to code that dictate what sex any given pokemon is going to be. however, i think this was only in generation 2 - because it was to do with shinies at the time. some shinies could only have good stats if they were male, etc. (which if you look into it could probably be read as a feminist kind of thing but its just because nintendo were figuring out how to get sex and shininess to cooperate, something to do with the code. they fixed this in either gen 3 or 4... i think)
on a non-coding perspective, it could work. i wonder if it could work on traded pokemon or pokemon from other games, though? sort of like how you can only renickname them if you own them originally. i feel like nintendo wouldn't actually go down this route right now though - yeah, okay, they can milk us for money sometimes, but unlike a lot of companies i feel like they're actually trying to be the best they can. after the whole tomodachi life thing i dont think they'll go down that route until they know they've researched into it and handled it respectfully. i mean, i could be wrong, considering i'm a nintendo-baby and therefore hugely biased towards it - but something tells me that they'd not want to risk alienating their audiences on that level.
that said - back to coding, they'd have to regenerate the pokemon to change the sex as things are. they'd have to find a way to make the way sex is set separate so that it doesn't interfere with any other values (including shininess, ivs, etc). my experience in observing the individual codes of some of the pokemon tells me it would be possible - but it would be a huge task needing an overhaul.
considering gen 7 is on it's way, they technically have the timeframe to do it now... if they've finished everything else. nintendo's got a lot of work on it's hands now and not a huge amount of time. call me weird, but i wouldnt mind waiting another year if it meant we could have more features/replayability factor/etc.