The guards spat on the soldiers.
The guards spat in his face.
Why do we use the preposition "in" with "face" ?

It's idiomatic. We say it that way because we like to say it that way. Emotion: smile

We also use the expression "in your face" to suggest that something you'd rather not be aware of is intruding into your private space. Your face is your window to the world, literally and figuratively.

We also say, "I saw him in the/my window" more often than "I saw him at the window."
Teachers: We supply a list of EFL job vacancies
Prepositions are not always subject to the rules of logic. Emotion: wink
 Avangi's reply was promoted to an answer.
Site Hint: Check out our list of pronunciation videos.
There is no really easy way to guess which preposition goes with which part of the body after "a verb of violent contact".

See The dog bit me on/in the leg.