The first thing I'll point out is that "only six months" is a strange perspective on medieval sieges. Six months on a castle as a small as Château-Gaillard is actually really good, and it outperformed almost all other English castles in Normandy during Phillip Augustus' invasion of the duchy from 1203-4. It did well.
But it is true that it maybe should have done better. We have the government financial records for its construction and it's hard to overstate the effort that went into it: hundreds (perhaps thousands) of labourers and a total cost of about £12,000, a cost that outstripped spending on all other royal castles in Richard's reign combined. Richard seems to have project managed the castle's construction himself, though we do not know how much of the design was his. When it was done, he apparently spoke of it as if it were his child. It was a very good castle, but Richard hoped it would be borderline impenetrable.
There are two sides to this question. The first is fundamental design issues with the castle; many historians think Château-Gaillard was more style than substance, and that Richard the Lionheart learned the wrong lessons from the castles he saw in the Holy Land which led to a design that looked impressive but was actually deeply flawed. The second reason is the decisions made by English leaders during the siege.
The Castle
Constructed from 1196–1198, Château-Gaillard combined many designs and innovations that were at the cutting edge of medieval technology, which Richard had seen during the Third Crusade and decided to incorporate into his new castle. It had at least five layers of defences: an outer palisade and moat, the outer bailey, the middle bailey, the inner bailey castle, and the keep. It was also built on a 90m cliff. The thickest parts of the wall were over 3m wide, so siege engines weren't going to do much against it. It was one of the first castles in Europe to feature machicolations for pouring boiling water or quicklime onto enemies. Sections of the wall (and all of the innermost castle wall) were curved to better repel impacts from trebuchets and ensure that there were no blind spots where a ladder could be put against the wall without an archer having a prime spot to kill anyone climbing it. It incorporated concentric layers of defence, which was considered experimental even in the Holy Land where the constant threat of war ensured castle design was always developing. Once complete, it probably looked a bit like this, which is somewhat imposing. It definitely looked like an invincible fortification.
But there were serious flaws, and it was arguably trying to do too much at once. The concentric nature of the castle, which was so key to many of the Holy Land fortresses that seem to have inspired Richard, was a bit half-arsed. It's as if Richard tried to combine a concentric design with more traditional motte-and-bailey structures and it didn't really work. As you can see in this map, the castle is split into three main parts: the outer bailey to the south (which is at the top of most diagrams of the castle, confusingly), which is separated by a moat and bridge from the middle bailey, which in turn contains concentric walls and earthworks forming the inner bailey. But these layers of defences were spread across a very narrow and long castle. Long castles of the time, like the fantastic Chepstow Castle in Wales, were viable but they did not break up their defences with internal ditches and bridges so that soldiers would not be impeded when rushing to defend a breach. This partition in the middle of Château-Gaillard meant that if there was to be a problem in the outer bailey then nobody could really help, because any breakthrough could be exploited long before anyone in the keep or inner bailey could get across their own bridges and ditches to help. In theory, the outer bailey was the first layer of defence. In practise, it was basically a separate castle stuck on its own.
There were also problems with the middle and inner bailey. It relied a lot on the imposing cliffs around it, and had structures built against the wall itself in areas where the cliff seemed impossible to climb. This introduced blind spots to the innermost layers of defence and small areas where infantry would be unable to respond; they would only be able to watch in horror as an attacker simply climbed onto the roof of the buildings, or perhaps smashed a window in one of them. It also seems to have had extensive plumbing, with a well in each bailey and a sewerage system. While that did help the defenders by ensuring a water supply, the waste had to go somewhere out which could become a way in. It looked amazing, but had fundamental weaknesses such that taking the castle could be as simple as finding the right bit of wall to put a ladder against. There was also the bridge into the innermost layer of defences, which was made of rock and could not be raised or destroyed in a hurry.
And the cliff it was built on is chalk, which is very soft and easy to dig through.
The Siege
When Phillip Augustus invaded Normandy in 1203, Château-Gaillard was his biggest target. It only had about 200 soldiers defending it, led by Roger de Lacey, but that was enough to hold for months on end against an army of thousands. As word spread that Phillip was invading, King John sent an army to reinforce and defend castles along the route of attack.
The point of a castle like Château-Gaillard was to tie down the enemy so that they would be unprepared for the arrival of a relief army; let them weaken themselves against the castle and then let the relieving force smash them to bits. In that respect, Château-Gaillard did its job and tied down nearly 10,000 French soldiers who could not otherwise contribute to Phillip Augustus' broader invasion plans. Furthermore, because of the local geography, the French force was split across the Siene river that meant they should have been unprepared to respond to a substantial relief army. However, the relief army messed up. There were two components to it, a land force led by William Marshal and a naval force coming up the river to destroy the French pontoon bridge across the river to keep the two halves of the French army from working together so they could be destroyed one at a time. The naval force was far too late, which meant that when Marshal showed up the French just ran across the pontoon to the other bank where Marshal could not fight them. After rearranging their forces, the French were able to drive off Marshal and destroy the naval force when it eventually showed up. King John apparently rode off in a strop without even telling anyone, and nobody even noticed his absence until he was about 20 miles away. If that doesn't sum up John as a military commander I don't know what does.
This meant the castle garrison of only 200 was on its own for the foreseeable future. At the start of the siege, and as word of the French invasion spread, Roger had opened the castle to locals seeking refuge. With the relief army defeated, Roger realised he desperately needed to conserve food and expelled non-combatants from the castle. The French initially allowed this, but Phillip intervened and forbid further departures by non-combatants and left hundreds of people starving between the French camps and the castle in the ope that Roger would be morally compelled to let them back in and deplete his food reserves. Roger did not, believing that if he rationed food to just soldiers then he could hold out until another relief army arrived.
Over the winter of 1203/4, Phillip decided to focus on the outer bailey. His siege engines pummelled it, and his sappers dug under it. By February 1204 it was clearly on the verge of crumbling and the French stormed it. The English defenders retreated to the middle bailey, recognising that the outer bailey was a death trap. However, the French noticed a structure on the side of the middle bailey that looked vulnerable. It was not part of the original design and had been put there by John, and it had a chute for waste disposal that dumped things off the cliff. A daring French soldier named Peter Bogis scaled the cliff, climbed up the chute, and lowered a rope to enable other French soldiers to enter the building. They then ran out, setting fire to everything they could and opening the gate to the middle bailey so the French could storm the next layer of defences. The English were now trapped in the inner castle, with just one wall and the keep remaining, and a bridge they couldn't destroy. The French simply ran across the rock bridge and, seeing that the castle was doomed, Roger de Lacey surrendered.
In the end, the castle fell due to its fundamental flaws. The cliffs offered theoretical protection, but the chalk was so soft that the French cut handholds into it and climbed parts of the cliffs that Richard assumed to be unscalable. The outer bailey was basically pointless. The middle and inner baileys were connected by a bridge that could not be destroyed or raised; a gift to any attacker. Once the French finally got inside, it fell like a house of cards as these design flaws made it impossible to defend.