The gesture suggests the image of one's brains rolling like a ball through one’s skull - i.e. that someone is out of control.
This sign is very wide-spread, but it is in Germany (and Austria) that it is the most insulting. Police may arrest those who use this gesture when driving. To avoid this, some Germans point their finger towards their cheek rather than their temple... faking a toothache in case of problems!