There are two main points to make here.
The first point is that UV radiation is entering the stratosphere from above (ignoring angular dependencies and scattering), so is preferentially absorbed by ozone higher in the stratosphere. This is a form of the Beer-Lambert law, which leads to greater absorption higher in the stratosphere.
The second point is that the Dobson Units used in your plot standardize for (partial) pressure and temperature differences between different heights in the stratosphere, so that you can compare the mass or number density of ozone at different levels. But it doesn't tell you how much ozone there is relative to all the other gases making up the air at a particular height. A common way to look at this is the mole mixing ratio:
A height–latitude cross section of annual average ozone mixing ratio (ppmv) from the climatology.
Source: McPeters et al (2005), Ozone climatological profiles for satellite retrieval algorithms, GRL.
While the ozone concentration peaks around 20 km, the mixing ratio peaks around 30 to 40 km and doesn’t decline so abruptly with height. Where the mixing ratio is greater, absorption of a particular amount of UV radiation can have a greater effect on the overall air temperature at that height.
The net effect of these two properties is that heating of the stratosphere by UV absorption (see plot below) peaks in the upper stratosphere around 50 km. This is why the greatest temperatures are found in the upper stratosphere.
Heating from absorption of UV radiation (K/day)
Source: Haigh (1984) Radiative heating in the lower stratosphere and the distribution of ozone in a two‐dimensional model, QJRMS.