Now I'm not an expert on this period of military history, so if what I've heard is loony, then go ahead and correct me; but I've read that the purpose of the Maginot Line was not to be France's shell per se, but to force Germany to go through neutral Belgium, thus (a) making Germany appear as lawless aggressors again and theoretically winning critical support from Britain and the U.S.; (b) protecting France's vital coal industry in Alsace-Lorraine; and (c) making a choke-point out of the German offensive, which gives an advantage to the Allies [anticipating to be defenders], especially since they wanted to wait for either a Soviet offensive or an American mobilization.
The grave error not being the Maginot Line in itself, but rather placing the worst divisions at Sedan, not scouting for a German offensive through the Ardennes, and then not counter-attacking when Guderian zipped toward the Channel leaving his flanks undefended. Though nobody nowadays is going to argue that the graver error wasn't choosing to turtle in Western Europe, at the expense of occupying Germany's industrial areas while the Western Front had almost nothing defending it.
It's quite easy to condemn the French High Command knowing what we do now, but a lot of their errors seemed sensible at the time. For instance, it wasn't readily apparent that the Belgian KW-line was an insufficient defense against mechanized divisions.