I clearly understand the meaning of 'what did you shop?' But I don't understand this 'for' at the end.
There is a subtle difference between the verb "shop" by itself, and the phrasal verb "shop for". In the context of ordinary commerce: By itself, "shop" simply implies the activity of going out and (potentially) buying things from shops. "Shop for" instead implies the activity of buying some specific item from the shops.
Yesterday we went shopping (= we had no specific purchase in mind)
Yesterday we went shopping for [warm winter coats for the kids]
You cannot ask "What did you shop?" if you want to know the intended purchase. Instead you must ask "what did you shop for?" However you may ask more general questions such as:
When did you shop?
Where did you shop?
Who did you shop with?
or other questions that may not directly relate to the intended items.
Side Note: "Shop" has other, colloquial, and relatively uncommon definitions. For these, "What did you shop?" might be fine.
Shop is an intransitive verb: it does not take an object. The things we intend to purchase are expressed with a preposition phrase headed by for:
We shopped for clothes at Marks & Spencer.
Consequently, when you ask your respondent to name the thing or things they intended to purchase, the interrogative (what) must be cast as the object of for. When the interrogtative is fronted it may carry the preposition with it ('pied-piping') —
For what did you shop?
—or the preposition may be left in place ('stranded'):
What did you shop for?
Pied-piping is preferred in formal registers, stranding in informal registers.
Without any other context, shop in your first sentence can have an ambiguous meaning.
What did you shop?
The use of a preposition clarifies the intended sense of the word.
What did you shop for (this Christmas)?
This is asking what you purchased. It's the more common of possible meanings, but it's not the only one.
What did you shop around (to the executives)?
Here, it's asking what you were trying to sell. The expression shopping something around is often used in the sense of trying to market an idea or product.
What did you shop out (of the picture)?
Here, it's being used in the colloquial sense of Photoshop, the popular graphic-editing application. It might be styled as Shop or 'shop, but often isn't. This sentence is asking what element was removed from a picture.
In each case, the use of a preposition makes the intended meaning of shop clear, distinguishing it from other interpretations.
As I mentioned, context can also make it clear, and often context means you don't have to use a preposition. But without context, a preposition will aid in the prevention of any misinterpretation.