Breakdown of Le gastaron una broma: le pusieron sal en el café.
en
in / on / by (means of transport) / about (after pensar)
el café
the coffee
poner
to put / to set (the table) / to make (an excuse) / to give, to impose (a fine, a penalty)
le
to him / to her / to you (formal) / him (direct object, male person)
Questions & Answers about Le gastaron una broma: le pusieron sal en el café.
Doesn't gastar usually mean "to spend"? Why is it used here?
It does! However, gastar una broma is a fixed expression in Spanish that means "to play a joke" or "to play a prank." You cannot use jugar (to play) when talking about playing pranks.
Why is the pronoun le used twice in this sentence?
Both times, le is an indirect object pronoun showing who receives or is affected by the action. They played a prank on him (le gastaron), and they put salt in the coffee for him (le pusieron). Without context, le could also mean "her" or formal "you."
Why does it say en el café instead of en su café (in his coffee)?
In Spanish, when an action affects someone's personal items, body parts, or food, it is much more natural to use the definite article (here, el) instead of a possessive word like su. Because we already have the pronoun le indicating whose coffee it is, Spanish doesn't need to repeat the ownership with su.
What is the infinitive of pusieron, and is it regular?
The infinitive is poner (to put). It is highly irregular in the preterite (completed past) tense. Its stem changes to pus-, which is why "they put" is pusieron instead of following the regular verb rules.