Because it's been a really good deal for the US.
1. European countries have (for the most part) not had an incentive to build military might, which means they won't be adversaries to the US.
2. This dependency on the US has given the US a lot of soft power in terms of diplomatic pull. In the past, the US could just ask Europe to jump, and Europeans would ask how high.
3. In addition to Europe, it's also kept Russia in check, because it has prevented them from expanding to the west.