Because the second "had" is about owning more money and the first "had" is to make a past tense.
They would fly to Canberra if they had more money. - Present tense.
They would have flown to Canberra if they had had more money. - Past tense.
Hopefully a linguist or teacher will be able to give a more technical answer, but that is why.