It’s purely to save on wages and related expenses. At my local the self checkouts have one person watching to help when the self checkouts call them (weight/item mismatch, receipt paper low, etc). The amount of people these self checkouts process would require 2-3 tills minimum for standard foot traffic + approx at least 2 for peak times. This requires those 2-3 being paid for a full shift plus two other, checkout trained staff nearby to be available to open lanes for overflow. All handled by a total of 2-3 checkout staff instead of 4-6.
So less wages, less money lost on training checkout capable staff, less management having to maintain a roster of sufficient staff, with sufficient hours to keep them around. Checkout staff generally wouldn’t do many other tasks back in the day beyond click and collect either and had a lot of idle time, because obviously you can’t be far from a till.