I try to be nice to cashiers since I know they take so much crap day in and day out. My friend works as a cashier for a grocery store, and I hear some horror stories from him either about co-workers or just customers being nasty.
I think it's just good customer service for cashiers to be nice, and to strike up conversation. The Customer is the only outlet for cashiers to make conversation anyway, so it's nice to have a bit of small talk. Also, it gives variety to the work day other than just being there like a robot helping customers and doing nothing else.