These answers pretty well cover several of your options, but I'd like chip in a few others.
As others have said, be aware of how the spell is cast. You must be within 30' of your initial target, must have line of sight on an initial mind-reading target, then must use an Action to switch it to a new target. OR you may scan for thoughts within 30' of you and use an Action to pick one of those thought sets to chose from
So, you have three options here.
1: You cast the spell, involving speech, gesticulation, and a copper coin within line of sight of your target. This is super suspicious. And will probably end in combat or summoned guards. And, however it pans out...the spell will have expired by the time things calm down.
2: You cast the spell outside the line of sight of the target, then move to within line of sight and shift the spell, this burns a round of time (I'll get to that in a second.) Assuming it only takes you 1 round to get into line of sight of the target. And, bear in mind, someone else might see you casting and freak out. I'd be calling for stealth checks here if they were in a populated area.
3: You cast the spell outside the line of sight of the target, then attempt to hone in on the thoughts of your target without moving into line of sight. The catch here is, you detect every intelligent creature within 30' and have to pick which one you want to focus on, consuming an Action. This includes your allies and any bystanders, and the spell does not give you any information about the intelligent creatures besides 'they are within range of the spell.' You don't even know which direction they are in. If this is how they are doing it, determine how many people are within range of the casting, and roll the dice to see if they picked the right person.
The spell lasts for 60 seconds. 10 rounds. Most conversations last significantly longer than that. And unless they cast the spell directly on the target (requiring line of sight) then they burn 6 seconds to take a round and Action to switch the spell to their desired target. So, more likely, they can Detect Surface Thoughts for 54 seconds.
So, have your NPCs engage in small talk...like actual people would. If the players try to push them straight to the topic, feed the person reading their mind thoughts about how rude they think the players talking to them are...and allow that to run a risk of the NPC refusing to talk to them further.
In social interaction, 60 seconds is not a long time. Particularly if the players cast the spell before trying to start the conversation. Have the NPC putter around their shop for a bit before coming to talk to them...have them be already talking to someone else when they arrive...have an interruption occur (such as someone else entering the shop). Anything that eats up time. They are taking a gamble by casting Detect Thoughts that the relevant topic will be discussed within 60 seconds. This isn't an interrogation where you just start demanding answers...and if they treat it like one, I'd expect no one to want to talk to the players next time they are in town.
Obviously, don't abuse this...let Detect Thoughts work sometimes. Otherwise you'll just frustrate them. But it shouldn't be the all-solving-hammer they are currently using it as.
If you have a villain, you want to block this, especially if they are going to deceive the players directly. For this, you need hard counters that absolutely block mind reading. You have a few options...
The obvious option here is Mind Blank. You are immune to mind reading. Period. They try to read your mind, and get nothing.
Next is the 17th level Mastermind-Archetype Rogue's ability, Soul of Deceit. They can block attempted mind reading with ease, or even roll Bluff to present false thoughts to attempts to do so.
Creative use of Modify Memory can bypass this. The villain could temporarily alter their memory (leaving a written note to tell them to undo the spell later) to believe they are telling the truth. Thus, 'Detect Thoughts' would accurately pick up on false information.
Mordenkainen's Private Sanctum shuts down Detect Thoughts entirely...one of the options is that no creature inside the Sanctum can be targeted by a Divination spell. You could even play this off as the other person casting or entering an area under the effect of the spell to 'make sure their conversation remains private.' The RAW allows for permanent versions of these...so a wealthy non-magic user could very well have a permanent Sanctum set up for private conversations.
Nondetection is probably the lowest level method of a hard-block. It makes the target immune to Divination spells (and, again, Detect Thoughts is a Divination Spell).
And, of course, Detect Magic would go off if a player using Detect Thoughts entered the caster's range. It wouldn't tell them specifically what you were up to, but they would know you were using a Divination spell in their presence.
Misinformed NPC. Have the character providing the information be entirely honest and truthful...but the information they give was provided by a deceptive source, so the NPC in question is honest...but wrong. The players may be able to use DT to be immune to manipulation, but the NPCs they talk to certainly aren't.
Pathological Liar. A character like this would probably think about several different 'answers' to their question with no distinction as to which one was true. You know they probably aren't telling you the truth...but good luck figuring out which of their thoughts was the truth.
Superfluous information. People's brains hop around all the time. Don't just give your players the relevant information..dump that NPC's whole stream of consciousness on them. Thinking about what's for dinner, wondering if these adventurers will shut up and buy something, grumping about that spider web they just spotted over your shoulder (I just swept the corners, dangit). Sure...they might get the info they are looking for, but they'll have to dig through a bunch of extra crap to find it.
Hopefully this helps out a bit