Grabbing a piece of gold adds two extra seconds to your timer, which helps you survive, and may increase your score. Some maps are full of gold, like 52-3: Think different, while some are so scarce in them that you may risk running out of time while attempting to complete them. Keep in mind that it is possible to hide trap door switches under gold pieces, and over-greediness may cause some bad results.
https://archive.is/20131014201251/img424.imageshack.us/img424/7905/gooszo8.png
- 52-3: Think different
http://img137.imageshack.us/img137/8820/24ap6.png
- 02-4- (Don't) go for the gold