There are several sex determining systems in animals.
In mammals XY = male(except in rare cases where SRY crosses with genes on the X so that it is the reverse) and XX = female.
In some birds it is just the opposite. That is XY(actually ZW) = fertile female and XX(actually ZZ) = fertile male.
In some reptiles it is determined by temperature and has no genetic determination.
In lots of insects there is XX = female and X0 = male. This is usually accompanied by males being haploid and females being diploid like it is in bees.
In some insects and reptiles there is also the ZW/ZZ system but they are not dependent on it. In other words ZZW in some insects and reptiles can give rise to either sex but there is no temperature determination either.
Why are there so many sex determining systems? Why did animals evolve to not all have the familiar XY system? It must be so confusing as to which species has which sex determining system when biologists are trying to determine the gender of an animal.