Many (but not all) shops in International departure (and to a lesser extent, arrivals) areas operate as "tax-free" or "duty-free" - even those that are not actually classified as tax or duty free shops.
In order to sell things duty/tax free, there are regulations that vary depending on the local laws (which could be federal, state or county/etc based laws) around how they must confirm that a passenger is indeed departing on an international flight and is thus allowed purchase goods duty/tax free - as opposed to (for example) someone that simply works in the airport and must pay taxes.
The exact requirements vary, but will frequently include things like name and/or passport details for the purchaser, and/or the flight number and date that they are departing.
For example, the UK rules include that :
You must provide your customer with an invoice or till receipt for
each sale, which must show the following details:
- voyage or flight number and date
[...]
And that these details must be taken from
- a boarding card
- airline ticket
which must include the:
- date of flight/voyage
- departure or boarding time
- flight/voyage number
- final destination
Specifically for the UK, a passport is not necessarily required, but the rules do state :
However, if you have any doubts that the passenger is genuine, ask to
see alternative documents (such as their airline ticket and, if
necessary their passport).
In order to avoid any potential issues, some shops may simply have a policy of asking for a passport from all passengers - in much the same way that many places will ask for ID from all patrons before selling alcohol/tobacco, even if the person is clearly over the legal age for those products.
Much like illegally selling alcohol/tabacco to a minor, selling good duty/tax free to someone that should not be purchasing them is a major issue that could result in large fines for the business - so having such a policy does have merit.
Edited to add :
The Question has now been modified to give Thailand as an example. Thailand has different duty/tax free requirements for citizens/non-citizens, as well as for ordinary passport holders compared to diplomatic passport holders. I can't confirm the documentation requirements as I don't speak Thai, but it would be at least feasible that they are required to keep details of the customers passport.