When I'd be out with my child when she was a newborn, little old ladies would say what a good dad you are, just from me being in public with her. Men of their generation just didn't do that.
While sexism is likely underlying many aspects of this type of commentary, I'd point out, though, that it's usually women making the comments, whatever they are. My ex wife's girlfriends said, 'You'll be a great mom,' before our child was born. I don't think it registers to guy to compliment people like that. I don't know what kind of parent some is going to be or is. And I'm not going to tell someone what great husband or wife I've observed them to be. ::shrugs::