Hindu rituals make it mandatory for Ganesha to be worshiped before the start of any Pooja.
Hence, Ganesha is a part of the frame. Also, Ganesha is generally considered as the Lord of wealth and the bestower of knowledge.
In Diwali we celebrate and workship wealth. But true wealth comes only when a person has knowledge or talent . Its said Lakshmi finds the home of the learned only. Since Saraswati is the goddess of books and music (talent), even she is worshiped with Ganesha.
You'll like to read about Devdutt Pattanaik's blogs. He explains all these questions very well.
Here is the link to his website: http://devdutt.com/