Is it okay to want to be with some people and not others based upon their behavior.

I feel as if I want to be with my husband if he is honest, loving, straightforward, faithful, but I don’t want to be with him if he is doing the opposite.
Sometimes he was kind and loving to me, or so it seemed (maybe he was love-bombing?).
Now he is mostly mean to me and superficially loving to our children.

It seems I’m supposed to love him no matter what he does, and I was loving him no matter what he did, and part of me still does, but also part of me is angry with him for lying, cheating, etc and not loving him for this, feeling hurt.