I think Frodo took pity on Gollum because he could relate to the burden that Gollum carried for so lone, but Sam was naturally suspicious of Gollum. Indeed I think any person would be if a creature like that attacked you in the middle of the night.
Gordis makes an interesting point with the "faithful dog"

analogy, but Frodo surely had to have some relationship with Sam if they were going to travel together.
Sam, to me, represents the ordinary man. He isn't awfully smart, but he is loving and loyal to those that he knows. Sam was always looking out for Frodo whenever danger arrived. Maybe he had something to prove to himself while doing this.
Gollum represents the inner struggle between good and evil. The Ring is what he wants, but he can't make up his mind whether to let the evil thing go and have long lasting happiness or hold onto it and be happy for the moment.