We were defending our country in Europe during WWII, but there are a heck of a lot of wrecks off the New Jersey coast that were lost to German submarines. If the Navy and the Merchant Marine cannot get out of the harbors, it’s going to be hard to bring the fight overseas.
We’re not fighting that war, now or in the future. Nobody has that sort of sub force operational (except us...).
Besides, the USN can field a pretty terrifying ASW air arm, if it needs to. They didn’t have this available until the middle of WWII.
And, I’m pretty sure, they keep an eye on “enemy” subs when they leave port.
However, if’n I were a bad guy, I wouldn’t bother with subs. I hire some container ships freighters, modify them just a little, and use ‘em to smuggle and deploy mines into US harbors. Unit for unit, mines were more effective torpedoes...