It is said that it is always easier to get a new job while you still have one. A potential new employer will inherently see you as a more valuable candidate than someone who is unemployed. Should you lose your current job, having to then explain to a potential employer why you are no longer with your previous employer could become dicey. I am not sure of legalities these days, as far human resources being able to say whether you are or are not eligible for rehire with their company, if they are called for a reference. If you are dismissed for sexual harassment and human resources, if contacted, can legally let a potential employer know you are not eligible for rehire, you could really be screwed if you wait too long to get a new job.
Whether the situation that is unfolding is legitimate or not, you may be best served in your career advancement to leave your current company and find another where you have a clean slate. Best to find other employment ASAP and do so, before you are surprised with a termination you may not see coming.
Unless you are at your dream company working your dream job, I'd seriously consider start networking for new opportunities. If you move quick it could be an easy transition. If you don't you could find yourself unemployed longer than usual. Leaving does not have to be an admission or sign of wrongdoing. You can claim to those asking (except potential new employers) that you were falsely accused and it's become a hostile environment as a result, or better yet say something else entirely and leave that out of it.
Better safe than sorry. Just as you did not expect the complaint, you may be misjudging how secure your current position is. Best not to be caught by surprise on this one, in my opinion, and move first, especially if you can secure something comparable or even better.