Generally the masculine gender is used when the gender of a subject isn't clear, or if the subjects are mixed. (niño=boy, niña=girl, los niños could be a group of boys or a group of children including both genders)
Latin, which Spanish is heavily related to, had another gender - neuter. That would've been cool to keep around. Well technically there is a neuter in Spanish, but not with nouns.
In Russian it's comparatively rare for non-binary people to wish to be addressed in the neuter gender, because this has similar connotations to being called "it" in English. I'd imagine that if Spanish kept the neuter of Latin that the effect would be similar.