'Can't speak' and 'doesn't speak' are not game terms, and thus we need to interpret them with their standard English meanings. Unfortunately, the verbs "can" and "do" are two of the most versatile in the English language, and grammatically, pretty much any interpretation could be valid. While I usually argue my answers focused on a text-based, RAW approach ('based on what is written, this has to be the meaning...'), that is not going to work here. Instead, I present what follows as one way to make sense of the words, that also works well interacting with other game elements. It is a functional, value-added approach rather than a prescriptive one.
Can't speak / doesn't speak are different
"Can't speak" refers to the inability to speak, typically because of physical limitations of form - the creature does not have the bodily capacity to reproduce the sounds of a spoken language. Sometimes it could mean a temporary physical condition is preventing speech: a creature that is gagged can't speak, and neither can one that is paralyzed. However, the creature would be able to speak if those conditions were removed.
"Doesn't speak" is a much more general term used to refer to creatures that for whatever reason do not communicate in a spoken language. This could be because they can't speak; they are physically incapable. But it could also be because of a lack of knowledge - my PC speaks Common, but doesn't speak Dwarven. He doesn't speak Dwarven not because he is physically incapable, but because he lacks the knowledge (represented in the rules as the language proficiency). If the creature doesn't speak any language, perhaps it lacks the mental organization needed to think in terms of language. "Doesn't speak" could also be because of a psychological block (such as selective mutism), or a conscious choice (such as a vow of silence).
A DM has decisions
For the Dungeon Master, "can't speak" is pretty clear-cut; the creature is physically incapable of speech and no more needs to be considered. "Doesn't speak" is less well-defined, and often when a creature listing says it 'doesn't speak' we are not told why. If relevant, the DM will then have to decide on the reason.
When does this matter?
If the creature is forced
A creature that 'doesn't speak' by choice can have that choice challenged by threat, bribery, torture, or magical compulsion. If the creature cannot speak, even such extreme measures will be unsuccessful. But if it doesn't speak, the DM will need to decide why and then go from there. Consider an Invisible Stalker, which as the OP notes, can and does speak Auran, understands Common, but 'doesn't speak' Common. What happens when an Invisible Stalker is sent after a party, but the party manages to capture it and then attempts to force it to reveal who sent it? Perhaps it 'does not speak Common' because such is beneath its dignity or mandate - but under magical compulsion it would. Or perhaps the elemental air form of its body allows it to reproduce the sounds of Auran, but it is physically incapable of speech in Common, and even magical compulsion to speak in Common will produce only the noises of wind.
The Detect Thoughts spell
Rather than force a creature to speak its thoughts, a caster might simply read those thoughts - provided they are organized in such a way that the caster (who thinks in terms of language) can understand them. The detect thoughts spell explicitly does not work on a creature with an Intelligence of 3 or lower (presumably their thoughts are not organized into language) or one that "doesn’t speak any language" - the spell will neither read the thoughts nor detect the presence of such a creature. It is important that the spell says "doesn't speak" rather than "can't speak". Gagging someone, cutting off their tongue, or paralyzing them does not protect them from detect thoughts.
Likewise, consider the Twig Blight, which is an "awakened plant" with an Intelligence of 4 that understands Common. Its description says that it "can't speak" - but we can reason that this is because its woody throat doesn't have anything capable of language production. But they understand Common and are susceptible to a Detect Thoughts spell. A Tree Blight, on the other hand, is even more Intelligent and understands both Common and Druidic, but it 'doesn't speak'. Why is it immune to detect thoughts? We are not told, but given that it is not awakened, as a DM I would say that its more authentic plant-based thoughts are not organized into any language the caster would understand.
Druids, by means of their wild shape, and other creatures, through polymorph, can assume new physical forms. Wild shape says (PHB 67):
your ability to speak or take any action that requires hands is limited to the capabilities of your beast form
True polymorph is similar,
The creature is limited in the actions it can perform by the nature of its new form, and it can’t speak, cast spells, or take any other action that requires hands or speech, unless its new form is capable of such actions.
while polymorph, in contrast, says:
The creature is limited in the actions it can perform by the nature of its new form, and it can't speak, cast spells, or take any other action that requires hands or speech.
Thus, a creature that has been polymorphed simply can't speak, regardless of the capacities of its new form, whereas a true-polymorphed or wild-shaped creature might be able to speak, if speech is within the capabilities of their new form. As Sage Advice says:
the intent (RAI) is that druids retain their knowledge, including of languages, when they transform and can speak the languages they know if an adopted form can speak.
Here again we need to distinguish whether the new form can't speak, and thus its physical incapacity would limit a shapechanger as well, or simply doesn't speak, which might allow a shaperchanger to speak in the new form even when a native of that form does not. Consider a druid who has wild shaped into a Raven, for example. The native raven has an Intelligence of 2 and has no languages listed (it "neither speaks nor understands" any languages). But it:
can mimic simple sounds it has heard, such as a person whispering, a baby crying, or an animal chittering.
A raven is physically capable of reproducing at least simple sounds of speech, it just lacks the intelligence to understand speech itself and put those sounds together into coherent words. Thus a native raven can speak, but it doesn't speak. When a druid wild shapes into a raven, however, they retain their Intelligence, and they are limited only by the capabilities of their new form. Thus a druid wild shaped into a raven could speak, for the raven has the vocal apparatus to do so and the druid retains their knowledge of language.
Detect thoughts ON a shapeshifter
Even if the new form of the shapeshifter is physically incapable of speech, the shifter themselves retains their knowledge of language, as described above. A druid wild shaped into an animal that can't speak would not be able to speak, but neither would they be protected against a detect thoughts spell.