Flippancy, Impertinent, Contrition
Flippancy- lack of respect in a serious moment; uncalled for levity
Ex: His flippancy was shocking, he made a fart joke ten seconds after she told him her terminal diagnosis.
Impertinent- disrespectful, rude
Ex: On second thought, it may have been an impertinent suggestion of mine to yell “throw on the game!” as they all huddled by the TV watching the second tower crumble to the ground.
Contrition- the state of feeling remorseful, sorry for improper behavior
Ex: Randy displayed insincere contrition for breaking the law; he felt bad about being caught, not about the actual act, which involved replacing all the soap in the Equinox locker rooms with sriracha mayo.