Q:

Reasons why liquid anhydrous ammonia fuel chosen for the X-15? Has it been used in other rocket engines?

Both Flight 90 and Flight 91 of the North American X-15 crossed the Kármán line, reaching altitudes of 106.01 and 107.96 km respectively. Both flights were piloted by Joseph A. Walker, who became in 1963 the "United States' seventh man in space" and "qualified him as an astronaut under the rules of the U.S. Air Force and the Fédération Aéronautique Internationale (FAI)"
From X-15:

By November 1960, Reaction Motors was able to deliver the XLR99 rocket engine, generating 57,000 pounds-force (250 kN) of thrust. The remaining 175 flights of the X-15 used XLR99 engines, in a single engine configuration. The XLR99 used anhydrous ammonia and liquid oxygen as propellant, and hydrogen peroxide to drive the high-speed turbopump that delivered propellants to the engine. It could burn 15,000 pounds (6,804 kg) of propellant in 80 seconds.

I hadn't heard of anhydrous ammonia as a fuel before reading this. It needs to be either pressurized or cryogenic (about -33C) to remain as a liquid, unlike organic fuels like alcohols or the heavier hydrocarbons. What were the various reasonings behind developing an ammonia burning engine in this case? Has ammonia been used again after the X-15? Or before for that matter!

above: Test pilot and astronaut Joseph A. Walker

above: Reaction Motors XLR99 rocket engine from here.

above X-15 from here.

A:

According to Clark's "Ignition!", German rocket scientists in WW2 had done the math on ammonia, and JPL had burned it with RFNA and WFNA oxidizers in 1949-1951.
Regarding the XLR99, Clark says:

But something more potent than alcohol was needed for the X-15 rocket-driven supersonic research plane. Hydrazine was the first choice, but it sometimes exploded when used for regenerative cooling, and in 1949, when the program was conceived, there wasn't enough of it around, anyway. Bob Truax of the Navy, along with Winternitz of Reaction Motors, which was to develop the 50,000 pounds thrust motor, settled on ammonia as a reasonably satisfactory second best. The oxygen-ammonia combination had been fired by JPL, but RMI really worked it out in the early 50's. The great stability of the ammonia molecule made it a tough customer to burn and from the beginning they were plagued with rough running and combustion instability. All sorts of additives to the fuel were tried in the hope of alleviating the condition, among them methylamine and acetylene. Twenty-two percent of the latter gave smooth combustion, but was dangerously unstable, and the mixture wasn't used long. The combustion problems were eventually cured by improving the injector design, but it was a long and noisy process.

At that point in time, state of the art in big rockets was the Redstone, which was burning 75/25 ethyl alcohol/water with LOX in an engine which was largely copied from the V-2; watering the fuel down was necessary to moderate combustion temperature. While regeneratively cooled, the design of the cooling tubes was not as complexly efficient at that time as it would be in later engines.
Kerosene would "coke up" (polymerize) in regeneratively cooled engines, potentially catastrophically clogging coolant tubes. That problem would eventually be solved by the development of the RP-1 kerosene specification in the mid-50s. 
So during the development of the XLR99, ammonia had a useful niche -- it gave better performance than 75% alcohol, was more suitable for regenerative cooling than cheap kerosene, and was safer than the hydrazine fuels.

A:

The book Aerofax Datagraph 2 / North American X-15/X-15A-2 by Ben Guenther, Jay Miller, and Terry Panopalis has some more info on the history of the propellant choice (page 27):

Eventually it was determined that the two most important requirements
  from a safety standpoint concerned the propellant combination, and the
  means of achieving combustion safety during starting and shut-down.
  Seven propellant combinations were explored in depth, these eventually
  being narrowed to liquid oxygen as the oxidizer and anhydrous ammonia
  as the fuel. The choice was based primarily on the fact that Reaction
  Motors had significant experience with liquid oxygen/ammonia
  propellant systems, and also on the fact that this propellant
  combination had much less critical starting characteristics. 
  Additionally, the liquid oxygen/ammmonia combination was an ideal
  coolant for the regenerative cooling of the proposed engine's thrust
  chamber.

FWIW, this book also has a good writeup on the developmental history of the XLR-99 and specifics on its design.
According to this pdf of a powerpoint presentation the choice was made because one of the chief designers at Reaction Motors Dr. Paul F. Winternitz was an advocate of NH3/LOX engines. 
Rationale for propellant choice:
The directive to use NH 3 came from Dr. Paul F. Winternitz, a
propellant scientist from Austria.

Dr. Winternitz had to find a fuel that would be stable, would be easy
to keep, show a good volumetric energy density, density, would work in
in the the temp range and allow conclusions for a later H2 fuel
system.
NH 3 /LOX fit the bill and it worked!
Later, when gravimetric energy density was more important than
volumetric energy density (for the Shuttle) H 2 was preferred
Good heat transfer properties

The presentation is a bit sketchy (and incorrectly states that an earlier Reaction Motors built engine, the XLR-10 was NH3 fueled), but includes this wonderful schematic of the XLR-99.

Interestingly, this presentation was given to the NH3 Fuel Association whose goals are 

to promote NH3 as an affordable, sustainable, carbon-free fuel for
  stationary power, transportation, and energy storage applications,
  thereby reducing dependence on fossil fuels and enabling the
  transition to a low-carbon economy.

A:

Chiming in as a long-time member of the NH3 Fuel Association.
First, a small correction. "Cryogenic" refers to gases that liquefy below -150 degrees C. As you state, ammonia liquefies at -33 degrees ... which is fairly close to ambient conditions in the industry. "Refrigerated" would be a more accurate term.
Second, you ask why ammonia was used as the rocket fuel for the X-15. I'm no engine expert, and others have addressed this here with more knowledge than I can, but I understand that the "coking" issue was vital: hydrocarbon fuels formed soot that affected performance, but ammonia contains no carbon and thus formed no soot. 
Third, you ask if ammonia was used before or after the X-15. Yes and yes. 
In the past ... Belgium, municipal buses in 1940s; Norway, demonstration truck in 1930s; Louisiana, public trolley car in 1870s (ammonia steam engine, working fluid not fuel). See https://nh3fuelassociation.org/introduction/.
Now underway: dozens of projects for carbon-free power and fuel, from island energy projects to national grid-scale import/export projects. See my website if you'd like to search for more information on projects around the world.

