It is a pronoun meaning "who" or "which" and changes depending on the gender of the noun it refers to.
Here's why it's masculine:
* "Qui" is used for masculine nouns. For example: "Le garçon qui chante" (The boy who sings).
* "Qui" is used for plural nouns, regardless of gender. For example: "Les enfants qui jouent" (The children who play).
* "Qui" is also used for things, which are considered neuter in French. For example: "La maison qui est bleue" (The house which is blue).
In summary: "Qui" is masculine in French, but it's the most common form used for both masculine and feminine nouns, as well as things.