Gender is a hot topic that gets a lot of people worked up, and that's perfectly understandable. So many people have been told that who they are isn't real. So many people who grew up only knowing the binary genders are struggling to understand that there are other genders out there, despite trying their best. (We won't even get into the hateful transphobes here.) I want to start this off by saying that "gender" in magic is not the same as gender identity. You can be any gender and still work with anything, even if its "gender" doesn't match up to yours.
Personally, I prefer to use "intense" (for masculine) and "gentle" (for feminine). I think this much more accurately illustrates the ideas that we try to get across when we say something is "masculine" or "feminine." The moon is gentle. The sun is intense. Water is gentle. Fire is intense. See?
But, for the sake of being historically sound, I will be using "masculine" and "feminine" in this post, since that's what so many of the old texts say.
Now that I've said what I needed to say about it, let's talk about sex.
I'm gonna lose the younger crowd if I keep this up.
Gender is brought up in several magical and philosophical systems throughout history. Wicca is a newer system, but it takes many of its parts from older teachings, such as old hermetic and alchemical texts.
The Kybalion lists gender as one of the 7 Principles of Hermeticism. This text, though relatively new (first published in 1912), is allegedly based on teachings passed down through the centuries which originated with Hermes Trismegistus (I cannot believe I spelled that right from memory), the legendary author of the Hermetica. According to The Kybalion, everything has a gender assigned to it. However, even if something has a "dominant" gender, it also has aspects of the opposite gender.
An easy way to imagine this is... well... with people. Someone who was assigned female at birth can still have "masculine" qualities, for example. There's probably no such thing as a 100% feminine female person. That goes the other way, too.
This also extends to non-living things. Fire is masculine, but it can create comfort and warmth, which are generally considered more "feminine" traits. Water is feminine, but it can cause destruction and danger, which are generally more "masculine" traits.
Another Hermetic principle that The Kybalion lists is the Principle of Polarity. This one goes well with the Principle of Gender because Polarity is about how opposites are really just two sides of the same thing. Heat and Cold are just different types of temperature with a lot of middle ground between them. Male and female are just different types of gender with a lot of middle ground between them, since every "feminine" thing has "masculine" qualities and vice versa. I feel that the combination of these two principles shows that magic doesn't endorse neat little boxes. Nothing is really clear-cut, and that's part of the beauty in this world.
I think that's about all I have to say on this subject.