Tenía a su lado el balón y le pegó una patada.
Why isn't lo used instead of le in this sentence? Doesn't lo refer to inanimate objects and le is used for animate objects? I think le refers to the ball.
Spanish Language Stack Exchange is a question and answer site for linguists, teachers, students and Spanish language enthusiasts in general wanting to discuss the finer points of the language. It only takes a minute to sign up.
Sign up to join this communityIn Standard Spanish, there is generally no distinction made in animacy for the object pronouns1. Lo and la are used for direct objects, being lo for masculine2 and la for feminine. Le is used for indirect objects3 and represents the recipient of an action.
This sentence is a bit tricky, because the verb doesn't correlate in transivity to English. Let's try rewriting it with some different words but the same structure to make it clearer:
Tenía a su lado su novia y le dio un anillo.
What was given (direct object)? un anillo. Whom was the ring given to? The fiancée.
Likewise, in your sentence, what was given?4 una patada. Whom was the kick given to? The ball. The ball is thus an indirect object, and the only option in Standard Spanish for a singular, third-person, indirect object pronoun is le.
1. The reality on the ground is that virtually every region within every country has its own tendencies on how to use lo, la, le, los, las, les. Some of these do include animacy, others formality, and probably other things too. Look up laísmo, loísmo, and leísmo for more information.
2. Can also be neuter or attributive in some circumstances.
3. Le is, however, accepted in Standard Spanish for masculine animate singular direct objects. Plural use is not accepted, though quite common.
4. Contextually, pegar una patada effectively means to give a kick here.
The answer from guifa is very good.
Please notice that in several regions of Spain people uses this forms in the wrong way. It's a phenomena known as "leísmo" when they use le form instead of lo/la and "laísmo" when they use lo/la instead of le.
As far as I know, it does not happen on South America.