Why is it necessary to keep UTC within 0.9 seconds from UT1? Why is it necessary to keep UTC within 0.9 seconds from UT1? I thought that UTC in fact more accurate than UT1, so why should it be based on UT1 within that range?
Another question would be, why isn't UTC kept within the range of UT2 instead of UT1, since UT2 contains more corrections than UT1?
 A: UT1 is an observational timescale.  It depends on the rotation of the earth with respect to the sun over time (even though it's actually measured by observing quasars).  As the earth slows down, so does UT1.  Over long periods of time, if UTC were not corrected, it would drift with respect to the mean sun.  Given long enough, noon UTC could differ from noon UT1 (when the sun would actually be high in the sky) by hours.  
You could pick any time period to correct UTC, but it was chosen to keep it within a second of UT1.  It could instead be set to stay within 60 seconds of UT1 and have fewer (but larger) corrections and few people would notice.  But by having to put in a leap second every couple of years, the mechanisms are exercised and folks are used to it.  Having to put in a leap minute every 40-90 years risks lots of problems as it would be rarely done.
UT2 was created with additional correction to UT1, but appears to be no longer used.  If it were used, it would be very close to UT1, so there would be almost no difference in the leap seconds that were applied.

if UTC must be kept within <0.9 range of UT1, why not just use UT1 instead for the mean solar day and let go of UTC?

Because UT1 is directly based on earth's rotation, it has a couple of drawbacks:


*

*The length of a "second" (1/86400 of a UT1 day) varies.

*The short-term variation of this second cannot be predicted.  (The long-term variation will be to increase in length as the earth's rotation slows)


Instead of a clock based on the rotating planet, an "atomic" timescale (TAI) is preferred for many other purposes.  The TAI timescale does not change within the precision of measurement.  UTC is then TAI, adjusted forward or backward by whole seconds until it is close to UT1.  It is easier to make a clock that ticks TAI/UTC seconds consitently, and then adjust its offset periodically.
A: After the CGPM redefined the second to be 9192631770 cycles of the cesium hyperfine transition the German Federal metrology department determined that it was no longer legal to broadcast time signals using the UT2-based seconds in the original form of what was known as UTC. This precipitated a(nother) crisis in the international time service community in order that everyone would be broadcasting according to the same scheme. Memoirs from H.M. Smith indicate that the discussions on how to resolve this issue involved the need for nations to change their laws, but the details of which laws are not in available publications. My guess is that either the German government would have to change its laws to allow for two kinds of seconds (SI and mean solar), or that every other nation would have to change its laws to allow that calendar days would no longer be determined by the rotation of the earth.
Rather than deal with changes of laws of the member nations, the preparatory meetings of CCIR working party 7 decided to propose broadcasting purely SI seconds with occasional steps as needed to keep the broadcasts aligned with the calendar day. The draft recommendation submitted to the CCIR plenary assembly allowed for steps of one or more SI seconds. Subsequent to the draft the astronomers involved with almanacs for celestial navigation requested that the steps be only one SI second with a maximum difference of 0.5 second, and that the radio broadcast time signals should include a way to transmit that difference. The US NBS created a way for WWV broadcasts to encode differences of up to 0.7 second. Then the Soviet delegates requested that the steps only occur on a limited number of pre-defined calendar dates.  The celestial navigation astronomers then pointed out that this made it impossible to keep the difference below 0.5 second.
At the 1970 CCIR plenary assembly the draft version of the recommendation was amended during the voting session so that the original version of CCIR Recommendation 460 allowed for steps of only one SI second; it mentioned UT (not UT2) and it gave no other rules for implementing leaps. Subsequent to the CCIR assembly astronomers at the IAU meeting pointed out that UT1 was better suited for navigation than UT2. CCIR Report 517 specified that the maximum difference from UT1 should be 0.7 second. During the first year (1972) of leap seconds the earth was rotating slower than it had since 1918, and even with 2 leap seconds the difference reached 0.9 second.
When the departure reached 0.9 seconds astronomers expressed concern that Bernard Guinot, head of BIH, might be blamed for failure. It could also have risked loss of funding to BIH for the failure and/or loss of respect for the CCIR because of having approved a recommendation that was not possible to implement. Along with other advice from the IAU all these changes were incorporated into the first revision CCIR Recommendation 460-1. These motivations and negotiations were not explained in the regulatory documents; they are only found in transcripts of other meetings and memoirs by the participants.
For a history of the different expressions that were used to calculate UT2 see https://www.ucolick.org/~sla/leapsecs/seasonal.html
As indicated in the above web page, the reason for creating UT2 was that by the 1950s the radio broadcast engineers with the quartz clocks at the time services were already trying various different schemes for using a constant frequency for the transmissions.  "Different" was deemed "unacceptable", so the IAU designated BIH as the sole authority for how the constant frequency scheme should work.  As with many regulatory documents this motivation is not presented in the transcripts of the IAU meeting which made the decision, but Nicolas Stoyko of BIH explained it in a subsequent issue of Bulletin Horaire.
At the same 1955 IAU meeting that decided to create UT2 Louis Essen of UK NPL also presented the initial results of the cesium atomic chronometer.  By 1959 the cesium chronometers clearly revealed that earth rotation had random fluctuations which meant that not even UT2 could be used for broadcasts with constant frequency.  In 1959 the UK started to regulate time broadcasts using cesium. That summer at a tea time meeting with time service personnel from the US in the house of Greenwich time service employee H.M. Smith the US agreed to do likewise, and thus the original form of what was called UTC was born.  By 1961 various international agencies recommended that all broadcasts should use this cesium-based scheme (and that BIH should manage this scheme), but the regulatory agencies did not incorporate all the details of the motivations, and throughout the 1960s they continued to specify UT2 even though the time service agencies had deemed that UT2 did not serve their purposes.
Celestial navigation does not want to know some smoothed, sortof constant frequency, estimate of how far the earth has rotated as given by UT2.  Celestial navigation wants to know how far the earth has rotated right now, and that is UT1.
The nature of the time service bureaus has always been that their national governments fund their existence and task them with the mandate and authority for telling their jurisdictions how to set clocks in a way that serves legal, practical, scientific, business, and international purposes.  They recognized, however, that they did not have the mandate nor authority to redefine the calendar.  The days of the calendar remain defined by the rotation of the earth, not by cesium atoms.  The inception of leap seconds arose from the dilemma of how to have time signal broadcasts with constant frequency while at the same time not redefining the calendar so that it was unrelated to the sun in the sky.
The IAU meeting in 1970 after the CCIR approval of leap seconds indicated significant disagreement about the leap second scheme. The USNO time service bureau indicated that their precise time broadcasts would not use leap seconds ( https://www.ucolick.org/~sla/leapsecs/leapincept.html ). The astronomical almanacs continued to use Ephemeris Time and Universal Time, not UTC. The contributions to the 1972 CCDS meeting included opinions akin to "nobody has to use this, especially not us", "blame the victim", and "let's not talk about this with other folks" ( https://pairlist6.pair.net/pipermail/leapsecs/2019-January/007070.html ). The CCIR admitted that UTC with leap seconds might not be appropriate for all purposes in Recommendation 485 ( https://www.itu.int/rec/R-REC-TF.485-2-199006-W/en ). The head of BIPM apologized that "regrettable misunderstandings, especially between astronomers and physicists, have crept into discussions on time and frequency." Other memoirs give the impression that folks were content not to deal with international agreements for the rest of their lives.
But during the decade after the CCIR approval of UTC with leap seconds that time scale was endorsed by various international and national agencies as the "perfect" time scale that should be used for all purposes. The bureaucrats who made those endorsements were not informed about the disagreement nor that technical applications were not using UTC with leap seconds. So UTC with leap seconds is the perfect time scale for bureaucrats, and the 0.9 second limit was established as one of the last technical inputs to the agreement.
International agreements are hard to make, and hard to change. It was not until 1999 that anyone raised the possibility of making significant changes to UTC. It took until 2015 for the ITU-R to schedule a vote at WRC, but in session it became clear that vote would be far from unanimous, so the ITU-R delayed further action until WRC 2023.
