Leading up to WW1, France had a formidable defensive line along its border with Germany but surely someone high up in the French military could surmise that Germany would try to go through Belgium in event of a war. Happened again with the construction of the Maginot line in the lead up to WW2. Relations with Belgium aside, seems like they didn't make a full hearted effort in the defense against Germany.
Well in First World War the Belgians had their own extensive modern fortifications that were destroyed by Krupps heavy artillery. Fortress around Liege and Namur as well as along the Meuse river. But they never expected to hold off the Germans indefinitely, only hoping to delay them until allies were able to mobilise to assist them. If that strategy worked is up for debate, Belgium fought Germans for a month, but their invasion plan was still on time.
In the second world war, the French had also operated on the presumption that in the event of war they would be given permission to enter Belgian territory to fight the invading Germans.
In 1920 Belgium signed an alliance with France, that France could enter Belgian territory in the event of a German invasion. so it didn't seem necessary to extend the Maginot line to the channel. It would send the wrong message to the Belgians and the French high command believed the Ardennes to be impassable anyway. France's resolve to defend Belgium seemed hollow though when they didn't oppose the re-militarisation of the Rhineland in 1936. So Belgium ended the alliance and declared themselves neutral, there was a rush of construction then extending the Maginot to the English channel but it was never of the quality and complexity of the original section.
They actually firstly did not want to violate Belgiums neutrality by building fortifications there (something I still don't understand), and also the fact that even when WWII came and the Germans invaded through Holland and Belgium, the French expected their Dutch and Belgian allies to hold the Germans until the French were in position. However what happened was a rout of the French allies and Germany landing in France faster than anticipated. The French also disregarded the notion that the Germans and their tanks would move through Ardennes region of France, a foresty area very difficult to maneuver in, which is exactly what the Germans did and once more caught the French off-guard. Another reason for the German breakthrough was their pioneering use of mechanised divisions, while the French still regarded tanks as mere infantry support, like artillery. There was actually an opinion in WWI by the French to march through Belgium to meet the Germans, but once more, neutrality issues meant that the French had no choice but to anticipate invading German armies in France.
In WWI, it was much the same, a combination of French Generals' arrogance and weakness of their Dutch/Belgian allies in staving off a German invasion - understandably. From the times of Frederick the Great Elector in the 1600s up to the end of WWII, Prussia/Germany was the most militaristic state on earth and small European armies could not hope to fend them off.
I never understood the French strategy from 1870, to 1914, to 1940. Each time the German army would move around the fortified Franco-German border and come at it from the other side through Belgium and the Netherlands, In my opinion fortifications like the Maginot line were just overglorified fancy forts. France suffered heavily in all its wars with Germany since its main industrial region was in the north, a place German armies would frequently visit.
In WWII, Hitler actually thought that the invasion of France would take years and result in millions of dead - but it ended in a month and only 30000-50000 dead.
source: [Beatrice Heuser: The Evolution Of Strategy]