as mentioned above some AM's are shut down to allow co-channel or first adjacent stations in other markets get a technical modification for better signal.
Other reasons?
Loss of tower lease, too expensive to renew ( WMEX 1510 Boston under the previous owners), although after it went dark Ed Perry bought the license, re-located it, down graded the signal, and is using it as the basis for a translator.
Some AM tower arrays were built in the middle of nowhere 50+++ years ago, and now that suburbia has expanded they are now sitting on some high dollar real estate that is worth multiples of what the station is.
If the station is not making $$$, you sell the land and walk away.
Some AM's have HUGE electric bills (again WMEX) that make the station unprofitable.
Some AM's you can't give away so they go dark
The list goes on, but the deck is stacked against AM stations, and you are going to see more of this happening IMHO unless the spectrum goes all digital and even then the small stations are going to be hard pressed to compete in a world where radio is becoming more and more irrelevant