why does gender exist?

can we just let ppl do whatever they want in daily life and just use sex in official documents? why does it exist