As far as I understand it, they were both under the same cultural influences for centuries and latter under the same education and social policies for decades. How did they end up so different?
I wouldn't say they were under the same cultural influences historically. There are a lot of similarities between Czechs and Slovaks but historically the Czech lands were their own kingdom, albeit German-influenced, whereas Slovakia was a region within the Kingdom of Hungary right up until the formation of Czechoslovakia in 1918.
Bohemia was heavily involved in the Protestant formation through the Hussite rebellion, then again in the Thirty Years' War - both conflicts in which they were opposed by Hungary and ergo Slovakia. During the Seven Years' War the (now Catholic) Czech lands are again being contested over by the (predominantly Protestant) Prussians, with the Prussians taking Czech Silesia and capturing Prague. Slovakia, as part of Hungary, doesn't have the same history of contention and conflict; Slovakia's challenges were always ones of independence rather than religious freedom.
I think the 'true' answer to OP's question is probably more sociological than historical, as the focus of both nations from the 19th century to 1918 was independence from Austro-Hungary, but understanding the number of conflicts with religious underpinnings in Bohemia and Moravia might go some way to explaining the modern religious divide.
tl;dr - The Czech lands had a lot of battles on religious grounds historically, whereas the Slovak lands didn't.