Refer the title. Why was this required? How is this related to ultraviolet catastrophe?
The model of EM radiation as a wave failed to predict the intensity curve for blackbody radiation at small wavelengths (hence the name "ultraviolet catastrophe"). The theoretical curve worked fine at large wavelengths but diverged at small wavelengths, and this was because it modelled EM radiation as waves that could exchange any amount of energy with the blackbody walls. To counter this, Planck hypothesized that atoms of the blackbody walls could only emit and absorb discrete energies of EM radiation called photons, and this model was found to be able to produce a curve of intensity against wavelength that could match the experimental curve. See also https://en.m.wikipedia.org/wiki/Ultraviolet_catastrophe