The thing about a sledgehammer is that if you're asleep in your house, you, your dog, your SO, or your neighbors might be startled awake by the sound of metal splitting and cracking open. Your security system might be designed to alert on something like a window being smashed. The person attempting to enter the house may be trying to enter undetected, because they know that a broken lock and/or a replaced lock will alert the people they're trying to ambush or steal from. Imagine something like industrial espionage, where a person breaks in undetected, steals an item, and then leaves. The occupant only realizes the item is gone a week later, and wonders if they could've misplaced it. In your scenario, they'd see the sledgehammered lock and immediately call the cops.
I see comments like these all the time on Reddit and Hackernews. Hackers are like, "locks aren't security, a sledgehammer breaks them" and it appears to betray a mental threat model of "what if the cops want my thing" and never "what if someone wishes to do me harm while I am in my house" or "what if a criminal wants to not get caught taking my things" or "what if someone wants to lie in wait in my house", which are not risks to these commenters. They are to a lot of people though.