First you have militarism, and in second you have alliances. Militarism was on huge causes for Germany’s involvement in the war, because Germans felt threatened by the big and growing British navy, so they competed by trying to grow their navy as well. And for Alliances, well in Europe there were two main alliances, The triple Entente which was made of France Britain and Russia; and the Triple Alliance, made up of Germany, Austria-Hungary and Italy. The Triple Alliance was also known as the Central Powers, The central powers felt that they were being encircled by France Russia and Britain, and felt it as a threat.
Those long-term causes were probably the main causes for Germany to join the war. But the desire for economic gain doesn’t really make sense because German’s economy was at a good point, it was already booming, and if they didn’t want to ruin that good economy by going into war; which would mean spending a lot of money for weapons and soldiers. Germany also had a good relationship with Britain in term of trading, so they didn’t want to ruin that relationship, because it would have cut them from the money given my trading.
But on the other hand, we could argue that Germany’s desire for money was great, and that they thought that there was a big rivalry between other European countries and their country. They wanted to build up a nation and have even more money. Germany also wanted to get more income out of their over seas colonies; but their neighbours, France and Britain had most of the countries with good resources, and gave a lot of income, Germany was in a way jealous of their booming economy, and wanted to get more colonies in order to get more money.