It isn't just engineers... Everyone does this. It's just a habit that people have like pen clicking or nail biting.
And then, on my mother's side, nobody I can think of does it. My mother hates leg-shaking. I try to be decent about it when she's in the room. Fortunately, my wife - who doesn't approve of legshaking, and seldom shakes a leg - doesn't really give me grief about it. Guess she's written me off as a leg-shaker, and accepted it as one of "those" things.