If the Earth's spinning were to stop (say due to a collision with something else) then it would still have gravity.
The gravity would feel a tiny bit different to someone standing on
the Earth, because the effects of being on a spinning platform, like a
merry-go-round, would be gone. Those effects, however, are very small
for us on the Earth.
Likewise, if the Earth were made of stuff that was much less dense, it wouldn't have much gravity even if it were spinning.
There's an interesting interplay between a spinning object and its
effect on the surrounding space, called "frame dragging". Here's a
simplified explanation, along with a preliminary measurement of it, as
described on CNN:
frame dragging news article on CNN
I also like to put in a link to Stanford University's Gravity Probe B
, another exepriment with precision gyroscopes in orbit around the Earth, designed to measure the frame-dragging effect.
(published on 10/22/2007)