Why are you asking Tom? He does not know the answer. Ask me instead!
No, I have not seen Tom for quite some time. Why do you ask?
Is it correct? And if it is, why the difference? Is it not in both cases a single action ('ask') happening at or around the time of speaking?
I guess that the answer is to do with the fact that, in the first sentence, the pupil knows why the teacher is asking Tom, (in order to get an answer, which goes without saying), whereas in the second sentence, I do not know the reason the person who asked me whether I had seen Tom lately did so.
The difference here would be parallel to the difference between Present Perfect Simple –'I have repaired the car.' – where the emphasis is on the result of the action, and Present Perfect Continuous – 'There is grease on my hands because I have been repairing the car.' – where the emphasis is on the action itself, is more descriptive, and we do not know whether the result, getting the car repaired, has been achieved or not.