It seems to me that you're either
just singing something you recognize, not knowing 100% exactly what it is,
not actively thinking about or understanding what you're hearing and what you want to sing in response,
or just plain tone deaf.
It's not 3. So let's look at 1 and 2.
I've known composers that have difficulties singing perfect fifths because they're so used to hearing tritones in 20th- and 21st-century music. Perhaps in your own musical memory you have grown accustomed to hearing scale-degree 7 (B in C major) jump down the tritone to scale-degree 4 (F in C major). It's unorthodox, and I don't know any examples that do this consistently enough for you to latch on to it, but perhaps.
What I ultimately think it is is that you're just not actively conceptualizing what you're trying to do. Try this exercise:
When you hear the B in the context of C major, you should actively recognize it as the "leading tone," the seventh scale degree which strives to resolve up a half step to tonic (scale-degree 1, in this case C). Sing this B out loud, then slide up a half step to C.
I expect you'll have no problems doing this task. If, however, you try to sing up a half step and accidentally end up singing down a tritone, I'm not sure an Internet forum is the best place to look for advice :-) ...find a local musician and work with them!
As the above exercise becomes second nature, I recommend singing these two pitches with syllables; perhaps singing the scale-degrees "sev" and "one," or even solfege of "ti" (or "si") up to "do." This way you won't be thinking about singing particular intervals ('up a half step'), but instead you'll be thinking of the functions of these scale degrees ('I'm singing 'sev,' I've got to resolve it to 'one!' ').