Yes, but done wrong grounded can actually be MORE dangerous than ungrounded as it can cause a flashover to happen where PEOPLE are.
The rules for effective ground are relatively simple but difficult to follow.
In the event of a direct hit, it doesn't matter. Near misses, on the other hand, occur more often and there it DOES matter.
I was two boats away from a blow boat in my marina that took a hit a few years ago directly on the mast. Every piece of electrical and electronic gear on the sailboat was destroyed. Several others boats in the vicinity took damage to varying degrees, mostly to electronics. Gigabite was untouched. I was aboard when it happened and it scared the bejeezus out of me.
Hatteras did a nice job of grounding things for factory options (my riggers were factory done, and WERE grounded) If you have aftermarket stuff you need to make sure its done right.
BTW, the sailboat's damage bill (covered by insurance) was north of $25,000.
I've also posted my story about a shrimper we saw get hit 100nm offshore one night here somewhere. That was freaky. Their entire electrical system was slagged; they had mechanical engines which were running at the time (good thing!) but NOTHING electrical beyond handheld battery-powered stuff worked.