Why AM is preferred over FM in long distance communication?
I don't think so. Voyager 1 is a great example of this - it uses phase modulation (similar to frequency modulation) and it has been able to transmit messages to earth that are ridiculously long distances away.

As always, the "link loss" between transmitter and receiver is paramount in understanding how much attenuation occurs between transmitter and receiver. This is: -

link loss (dB) = = 32.45 + 20\$log_{10}\$(f) + 20\$log_{10}\$(d)

Where f is in MHz and d is in kilometres. This equation tells you how many dB of power loss you can expect at a given distance with a given carrier frequency.

What you may be influencing your question is that ionospheric bounce occurs quite well in the lower frequencies that are dominated by public AM transmission such as a local radio station. AM is used not because it gets further but because the thousands of radio receivers tuned-in have a simpler job demodulating the transmission i.e. it is cost driven - non-suppressed carrier AM is easy and cheap to decode, hence the extremely simple crystal set radios of the last century.