The line is in the game for RP reasons. Not all Hawkes need be socially conscious or sensitive to others. Some might not cope well with loss, possibly stemming from their own losses, some of which are recent and could leave their defenses down.
Plus, the Hawke family canonically has two mages to three mages, possibly including Hawke themselves. In all probability, this entails a life largely on the move, and one in which few close friendships would’ve been established. Indeed, Hawke might’ve had little experience having to deal with outsiders at all, at least not on a regular basis, all of which can translate into poor people skills.
Or Hawke could just be the sort of person who can’t handle bad situations; such feelings would overwhelm them. So they throw out a joke to mask their real feelings. Better to piss someone else than tap into the depths of sorrow and loss that have followed Hawke around all their life.
And also, playing a purple Hawke doesn’t mean you have to take every purple option in the game. It always rankles me when people write off purple Hawke as pure buffoon or completely callous when the awkward, pained delivery of some of these “jokes” provides more than enough evidence for an alternative interpretation.