I live about an hour from SF, and I have to say for a 2 1/2 year old the Pier / Fisherman's Warf area would be my vote. There is an aquarium, Sea Lions and a Carousel to play on/ in. Nice places to eat and some souveneir shops as well.
I second the vote for Gilroy Gardens, it's perfect for his age and it is really a nice place. If your child was older I would recommend some of the museums or the Academy of Science. Or even Santa Cruz Beach Board Walk.