Why the earth attracts charge and where does the charge go when it goes into ground?
As a planet overall, the Earth is electrically neutral.

However, the surface of the ground can have a localized charge in certain areas, such as under storm clouds.



(Source)

The action of wind and droplets of water within the cloud causes the charge at the top of the cloud to be positive with respect to the bottom of the cloud. The strong negative charge at the bottom of the cloud also induces a corresponding positive charge in the ground directly below it.

It is this lower charge distribution that is responsible for cloud-to-ground lightning.