While the linked article points out the faults with A400M development it conveniently ignores the history of the development programme of the C-17 itself and the problems it encountered during the 1990s, including a redesign of the wings after they failed a strength test. During the course of that McDonnell Douglas and the Boeing have had to book substantial financial losses.
It also ignores the fact that the last C-17 was delivered back in 2019 after Boeing had built the last 10 before they had buyers for the aircraft. Such was the low demand for an aircraft with its capabilities in the world. Bottom line is that the C-17 is/was too big and was too expensive for most nations requirements.
As for the RAF C-17s, the initial 4 aircraft were not purchased to begin with. They were acquired on a 7 year lease, including support, at £100m per year, and with restrictions on their use with delivery in 2001. We then spent more money to buy them outright around 2008. We then acquired another pair in 2008 followed by the final pair in 2011 & 2012. And since 2008 we have been paying regularly for maintenance contracts. And we have also been spending on upgrades.
As for being able to buy a new C-130 today for £145m with support, my question would be how long is the support package for and exactly what does it cover?
As for the RAF C-130J, the RAF was a launch customer in 1994 around the same time that Britain was signing up for the A400M. The aircraft were delivered between 1998 and 2000 since when they have been ridden hard. They were due to receive new centre wing boxes, until defence cutbacks saw the project curtailed after only a handful had been upgraded.
So the RAF C-130J are worn out and need replaced/upgraded, C-17 is out of production and the money has already been spent on the A400M.
Edit:- note C-17 production ended in 2015 the last 5 delivered (4 in 2016 to Qatar and one to India in 2019) were "white tails" sitting on the ramp looking for a buyer. Probably represented a bargain!