Can you be fired for having integrity? Yes. For having empathy? Yes. For speaking truth? Yes, of course, especially when your boss has an aversion to truth, integrity, and people with backbone.
You can be fired for saying things about character as essential to leadership. Like this:
"Before you can lead others, you have to lead yourself. We must develop leaders of character that are ready to create and foster environments of respect, inclusivity, and trust."
That quote was deleted from Air Force Handbook 1 last week when the man who said it was fired.
For showing character and ranking high in integrity, General C.Q. Brown was fired. This is a picture of heroism in the line of duty.