The vote spells a crushing defeat for the opponents who gathered the 50,000 signatures needed to put a law change to a referendum, warning the law's internet restrictions pose a serious threat to liberties online.
It will enable Swiss companies for the first time to offer online gambling, but will basically block foreign-based companies from the market.
This aspect of the law in particular spurred a coalition made up primarily of the youth wings of various political parties to launch the referendum.
Opponents have slammed Bern for employing "methods worthy of an authoritarian state", with a measure that they claim is "censorship of the internet."
"This sets a very dangerous precedent," Luzian Franzini, co-president of The Greens' youth wing and head of the campaign against the new law, told AFP before the vote.
Swiss Justice Minister Simonetta Sommaruga, however, insists that allowing only Swiss-based companies to sell gambling services is "indispensable" to ensure that everyone adheres to strict rules, like blocking known addicts.