@dashv you raise some interesting questions.
In addition to what others already said: Because it’s information. MB stores lots of information about artists. Not all of it is directly related to music (siblings, partners, …).
Demographics I guess.
Nobody, but there is some guesswork involved for much info on MB. E.g. if I listen to an album of an artist and it sounds like instrumental hip hop to me so I tag the artist “instrumental hip hop” but maybe the artists considers themself an electronic artist.
I think it’s alright to add such data as long as the intention is good, the possibility exists to label anybody with the correct gender and the choice of the gender is not just guesswork without any basis (at least based on the name).
In a perfect world nobody would have a gender assigned to them until they are old enough to know which one is the correct one for them and kids would be raised without stereotypes, but that’s not the world we live in.
This is a really good point. Many people today live in an environment where they don’t have to fear for their lives when they come out as non-binary, but this was not always the case. Non-binary genders are not a new phenomenon, it’s just more heard of and accepted nowadays. So we can assume that many deceased people were non-binary, but never came out.
An idea to address your last two question and based on @Llama_lover’s idea: There could be a checkbox when you edit an artists gender to determine whether it’s just guesswork or based on a quote of the artist. This would probably be left unchecked for most artists that are male or female in the database (because in today’s world you usually don’t “come out” as male or female), but it shouldn’t be a requirement for some and not for other genders.
Like I mentioned above Wikidata does mention genders. But that’s the only example I know too.