Teachers like to tell kids that there is no such thing as a stupid question. If understood as an exaggeration, that's fine: it makes a point which is particularly important for schoolchildren. That, however, is no excuse for adults to mindlessly repeat it as though it were a fundamental truth with no exceptions.
For the sake of clarity, let's call the person asking the question Quincy and the person who hears it (whether or not it is addressed to her) Heather.
A question might be stupid because it reveals too much about what Quincy knows or does not know. For example, if Heather is trying to sell something to Quincy, it might not be in his interest to let her know he does not understand all the details about what he is buying; she might try to persuade him to buy features he does not really need or charge him more than the fair market price.
Alternatively, a question can make an unfair insinuation. These are particularly obnoxious, because they allow Quincy to cause all the harm of a direct accusation while still providing him cover under the excuse, "I was just asking a question!" A friend of mine has suffered a good deal recently due to just such a hateful question -- in this case, a very intrusive, personal question from someone who was no more than a casual acquaintance, and who has used it to spread hurtful gossip across the dog park my friend has been using.
A question can also be stupid if it predictably and unnecessarily brings up painful memories for Heather.
This has also been brought home to me by recent events. A few days ago I discovered that a friend I had known many years ago, but with whom I had not been in regular contact, has passed away. The last time I communicated with this friend, she made a comment that was shockingly out of character. The comment did not in any way involve me, but the friend would have undoubtedly known that it would disturb me. In fact, I did not believe the comment could be taken at face value; I suspected it to have been an indirect message to get lost. Not knowing how else to respond, that is what I did. So now, if I am troubled by uncertainty about what exactly was going on near the end of this friend's life, I must live with that uncertainty. The opportunity to ask my friend is gone, and it would be massively inappropriate to ask for clarification from anyone who was closer to her in her last days -- both because it would bring up painful memories of her loss, and because it might appear I was trying to besmirch her memory.
An old standard piece of spiritual advice is to speak only when necessary. For most people under most circumstances, I don't think that needs to be interpreted very rigorously, but I do think it makes an important point. After all, we are told that we must give an account for "every careless word". Some of those careless words are formed into questions that really are stupid.