This entire argument is based off a false, socially constructed idea that there are only two genders and everyone perfectly matches into one of these two gender categories. That's just not the case. The fact is that people who don't fit neatly into one of those categories still need to use the bathroom safely and comfortably. Basing bathrooms off "biology" is just dumb. Everyone has a different biological makeup, and only some people actually fit, 100%, the biological sex characteristics of "their gender".
Short of literally genetically testing people to see what their chromosomes look like, there is no way to sort people into those categories before they use the restroom. As many have said, "keeping pedophiles out" is a straw man... no one is going to show up in a wig and heels so they can prey on innocent little girls in the bathroom....a pedophile is going to walk in and kidnap a little girl if that's what they want to do. Women and men can both be predators.
The real issue is that people feel uncomfortable with things that they do not understand. Transgender people do NOT want anyone calling attention to them in the bathroom. A trans woman who has a tall, masculine frame but is wearing a skirt and makeup is not going to feel comfortable or safe in the men's room, they aren't male. If you are opposed to this, I just ask you to consider the idea that transgender people are humans like all of us who literally just want to do their business.
I'd rather eliminate the gender dichotomy all together, but obviously we aren't going to, and we are not going to replace all bathrooms with gender neutral ones. So therefore, I sure wish that we could get to a place in society where everyone could use the bathroom that they feel safe and comfortable in, that *most* aligns with the gender that they identify with. There should also be a single-stall bathroom for those with disabilities, need privacy, families, or don't feel comfortable using any gendered bathroom, and they should be widely available and not tucked into a vague corner of the park etc. I'm sorry if someone feels uncomfortable with the idea that there might be a piece of junk that doesn't match what they have in the bathroom at the same time as them, but that person's discomfort is not worth completely degrading another person's life or endangering their safety. Walk in, do your business, wash your hands, leave. I would be willing to bet the transgender person is trying to do the exact same thing.