1. Cost - submarines are a PITA and expensive to build and maintain compared to a 'regular' ship. Also torpedoes are very expensive, about 2.5x the cost of a Tomahawk which is often a perfectly adequate solution in a lot of cases.
2. Radar - No use underwater unfortunately.
3. Planes - If you want to launch lots very quickly, you need to be on the surface. Likewise if you want to shoot one down, it's much easier if you're on the surface.
4. Missile defense - ties in with Radar I guess, but if you want to intercept a missile it's much easier to do from the surface.
5. Amphibious assault/landing - much easier to sling out some landing craft and amphibious vehicles on the surface than it is underwater. It's also much easier to transport large numbers of them.
6. Size and weight - I could waffle on for paragraphs about this but tl;dr size/weight = need more power. Generating power is very hard and/or expensive to do quietly, so it makes sense to try and keep subs no bigger than they need to be.
7. Show of force - A deterrent will only deter someone if they know it's there, and you're not supposed to know where a submarine is.
Having said that, submarines are incredibly useful machines within their own domain - sneaking around and either doing or supporting clandestine operations, and in some cases acting as a very credible nuclear deterrent.
Remarkable story, https://en.wikipedia.org/wiki/Scuttling_of_the_German_fleet_...
The unsalvaged ones are still popular dive sites.