Some say that shaking “bruises the gin” which suppossedly affects the taste and that you should NOT do it (and the Bond in the books and film Casino Royale drank gin martinis, not vodka). I’ve found that is a bunch of rubbish – it makes no difference at all.
The real thing that shaking does is break up the ice more, which results in a more diluted drink (and the original recipe for the Vesper, AKA the “Bond martini”, has three measures of gin and two of vodka – a LOT of alcohol for one drink). So maybe Bond, being on a mission, knew he needed to not get TOO drunk while on duty.
Or maybe it was a simple affectation. I think the latter is more likely.