Germany shared a huge border with France so why did Germany attacked from Belgium and expanded the conflict. Was there any real benefit to Germany for attacking Belgium?
The border between France and Germany was guarded and is somewhat mountainous. Belgium is flat, had good logistics (good roads/railroads) and France didn't have as many troops stationed on the border with Belgium.
So, the Franco-German border has been one of those "traditional" invasion routes going between western and central Europe. Its a mountainous and wooded area that the French had continually fortified for hundreds of years. Following the 1871 defeat, they had built more modern fortifications which screened the border. Further, the entire French army deployed across the border in anticipation of an attack through the Vosges Mountains (the border mountains).
By going through Belgium, the Germans were able to bypass the bulk of French fortifications which stood in good defensive terrain. Further, the French army was largely bypassed, while the German army was concentrated on the flank and rear of the French army. The French offensive plan was invalidated: they found themselves attacking the center of the German army, rather than the outside flank (as they had planned earlier). Germany gained a lot by violating the Belgian border, and had they beaten the French at the Marne, it would have been a risk that paid off in dividends. But, given the course of the actual war, you could see how they ended up losing more than they gained, especially with bringing England into the war. However, its also important to remember that until September 1914, the Germans fully believed that the campaign was only going to take weeks to complete. They didnt think the war would last till winter, let alone for 4 years. So they made decisions which produced immediate results, regardless of the long-term implications of that decision.