With a heavy heart, Goddess Lakshmi went to Goddess Parvati to seek help. Since Parvati had two sons, She requested the Goddess to let Her adopt one of Her sons to experience the joy of motherhood. Parvati was reluctant to let Lakshmi adopt Her son because it was known that Lakshmi does not stay in one place for long. So, she would not be able to take care of Her son. But Lakshmi assured Her that She would take care of Her son in every possible way and bestow Him with all the happiness.
Understanding Lakshmi's pain, Goddess Parvati let Her adopt Ganesha as Her son. Goddess Lakshmi became extremely elated and said that She will bestow Ganesha with all Her accomplishments and prosperity. Those worshipping Lakshmi for wealth would first have to worship Ganesha to seek Her blessings.
Hence, Lakshmi is always worshipped along with Ganesha on Diwali. Gaining wealth without intellect will only result in misusing the wealth. So, one must first acquire the intelligence to spend the wealth in the right manner. Therefore, Lakshmi and Ganesha are worshipped together.