Connecting a digital timer with 4 wires in a box with only three wire, white, black, and ground
Yes this is bad/dangerous because you now have current running on the ground wire at all times.  This type of timer requires a seperate neutral (whereas most switches just interrupt the hot) so that the timer can be powered when the switch is in the off position.

In your configuration, the line (power) comes in at the fixture and there is likely a 14/2 cable running to the switch for the sole purpose of interrupting the hot. The other configuration is where the line comes in at the switch which then sends power to the fixture when the switch is closed.

In order for you to use this type of timer, you need a dedicated neutral in the box with the switch.  You would need to replace the 14/2 cable with a 14/3 cable (extra conductor) so that you can have a dedicated neutral from the line, and then still switch the hot to control the light. 

Depending on the position of the switch and fixture it may be easy enough to pull a new 14/3 cable.