I just can't understand why it costs literally millions of dollars to connect district cooling to an apartment building.

It doesn't sound like a 'connection' cost to me, but rather Qatar Cool is trying to repay all their investment costs in one year, rather than spreading them out over a number of years.