In the states, the Anti-Nicotine-Tobacco Zealots (ANTZ), who worked so long to denormalize smoking, were corrupted by the tobacco industry. Both groups have plenty of experience swaying public opinion via the media, and both view vaping as an existential threat, so they've teamed up to fight it. And governments which have grown dependent on the revenue from sky-high tobacco taxes are reluctant support it, because it's unlikely they could ever see similar revenues from liquid nicotine. They all had a good thing going, and then vaping came along and rocked their boat. The official rationales, of course, are "insufficient testing" and "for the good of the children".
There's an amusing article about it that reads like a satire but may be truer than it seems:
The Rest of the Story: Tobacco and Alcohol News Analysis and Commentary: Based Solely on Quotes from Anti-Tobacco Groups, Big Tobacco Tells America's 3 Million Nonsmoking Vapers They Would Be Healthier Going Back to Smoking
Canada has a rosier outlook (at least in my opinion). The entire country recently legalized pot and the government is on record as saying that it recommends alternative forms of consumption over smoking. It would be unjust and impractical for them to specifically discriminate against nicotine vaping when they are OK with other thing. They do, however, lump vaping and smoking together and require both to be done outdoors in designated areas. We are influenced more by the UK than the US.
The UK government is one of the friendliest governments in the world to vaping, which they accurately portray as a much safer alternative to smoking. Although they have inherited some bizarre EU laws which restrict maximum strength of nicotine liquid, and device capacity, they are not hostile. They are also seriously considering leaving the EU entirely.
A few countries, such as Singapore and Turkmenistan, have outlawed vaping entirely, while many others restrict the sale and import.
tl;dr Generally the motivation behind anti-vaping legislation seems to be corruption and a desire to protect national tobacco tax revenues at the expense of neglecting the public good.