Why were submarines not made sound proof?
They were and are
We have to remember that the term soundproof suggests an unreachable ideal terrestrially. All real-world soundproofing systems are only partially effective. You can reduce sound but you can never completely eliminate it in practise (outside a laboratory).
Sound reduction has a cost. It may be better to have ten quiet submarines than one very quiet submarine. Particularly if the quiet submarines have better speed, better range, more and better armaments then the very quiet submarine.
Water is a great transmission medium for sound. Sound travels faster in water than in air. Whale song can be heard 80-160 km (50-100 miles).
Traditional submarines are intrinsically noisy. They are generally constructed almost entirely of metals and contain a great amount of machinery and metal objects and tools. Of necessity a lot of the internal metalwork and machinery (plumbing, propulsion, controls, periscopes, hatches) is connected to metal surfaces that are in contact with exterior water. This is also true of the structural elements - floors, walkways and so on.
Space is often at a premium. Soundproofing materials and measures often consume significant space.
All these aspects make creating a soundproof submarine a challenge.