@Siggi ******
There certainly is a legal base to ask, it is one of the requirements for DTV visa.
Every visa holder can always be asked to show they still comply with visa requirements.
That is not only in Thailand, but everywhere in the world. A visa is never a document that gives you right to enter a country without checks.
Normally they will not check, but if for some reason they want, they can.