The policeman was signaling. In this case, the signal was "to stop". It was not directed at any particular motorist, but just a general signal to everyone, including John.
Examples:
The foreman signaled to shut down the production line.
The publicist signaled that the interview was over.
In both of these cases the signal was directed to everyone, with the assumption that the relevant people would see it and take appropriate action.
As you note, you can also signal to someone, if you want to communicate specifically with them:
The policeman signaled to John to pull over.
The sergeant signaled to the soldiers to fall out of formation.
The preposition is (normally) optional, but if you use one it should be "to" the intended recipient. "For" is used to describe the signal itself.
The event coordinator signaled to the band leader to start the music.
The event coordinator signaled for the music to start.
You can also say something like:
The event coordinator signaled for the band leader to start the music.
but note that this tells us about the purpose of the signal.