Partly because the UK were supporting AIrbus as an industry - there wasn't much UK content on either a C-130 or C-17
Partly on cost grounds - the C-17's sold to India were over $ 350 million each whereas the "target " price for an A400 is $85 million but are more like $ 120 million each