The hard water contains Ca+2 and Mg+2 ions that remain in the form of a high mineral contents, like Ca/Mg sulfides, chlorides , carbonates and bicarbonates etc. which are insoluble in soaps and gives the insoluble product i.e the scum with the soap molecules like sodium stearate etc.
This scum is formed because the calcium and magnesium ions are not soluble in water and due to these ions only the hardness in water is seen.