It is generally true that, as parents, you want to have a united front WRT kids as often as reasonably possible. Like any guideline, it may not "always" be right or appropriate. This can be a tough spot to navigate. To be the best dad, it may be necessary to prioritize what's best for you inidividually and then your kids. As I was just reading in another thread (I believe Caligirl's and a post from Job), you have to put your own oxygen mask on first before helping others with theirs, as we hear from flight attendants before any flight.

You can only control yourself. If you kids don't see you behaving in ways the demonstrate animosity, but do see your spouse doing so, they will remember that over time. Over 40 years ago, my parents got divorced and I can tell you to this day every way I saw my mother act with animosity towards my father. By comparison, my dad consistently took the high road. Over the longer-term, it led to a better relationship between he and I than me with my mothers. I respected and looked up to him more. When my W filed for divorce, my D15 absolutely saw a balance of me acting in the most civil manner possible while maintaining my personal values/boundaries. It is a different way to think about being the best dad to your kids by practicing a bit of self-care/orientation.

I hope that is helpful.