The proposal by the right-wing Swiss People's Party (SVP) was quashed by 123 votes to 57, reported news agency ATS.
The bill was lodged as a result of last year's furore at a school in Therwil, in the canton of Basel-Land, when two Muslim boys refused to shake their female teacher's hand for religious reasons.
The school initially allowed them to be temporarily exempted from the practice, which caused an outcry across Switzerland, with many people feeling the boys' refusal was an affront to Swiss culture, since handshaking between schoolchildren and their teachers is customary in Switzerland.
Even Justice Minister Simonetta Sommaruga stepped into the row, saying at the time that shaking hands was part of Swiss culture.
Two months later the education authorities in Basel-Land ruled overturned the boys' exemption, saying the public interest regarding the integration of foreigners and equality between men and women outweighed the students' freedom of religion.
Schoolchildren in the canton are now obliged to shake hands, or their parents will be liable for fines of up to 5,000 francs.
While cantons are free to set their own rules on the subject, on Tuesday parliament decided it was not a federal issue.
Drawing on Sommaruga's words, Basel-Land MP Sandra Sollberger, who lodged the bill, said refusing to shake hands constituted a lack of respect. The federal government should therefore establish a legal base to oblige all schoolchildren to shake hands.
But Sommaruga opposed the bill, reported ATS, saying the cantons set their own education policy and it is not for the federal authorities to legislate on the matter.