He does treat Harry badly, but Snape is a product of his upbringing unfortunately. From what has been written, he didn't have a great home life. We know he was bullied constantly at Hogwarts, by Harry's father no less and Sirius Black, so I can see where he's coming from. Not to mention, he has a life debt to pay to James, which means he's bound to protect Harry, the son of the man who made your life miserable.
Then he became a Death Eater, probably hoping to gain some respect. What happened after that we don't know, but he began working for Dumbledore. He's hated by everyone and mistrusted. The only person who trusted him was Dumbledore. Note that whenever Harry asks anyone in the Order if they trust Snape, they all say the same thing, "Dumbledore trusts him." So right there you know this guy is not only protecting the son of his enemy, he's working for people who don't like him or trust him.
I feel bad for Harry, but I also feel bad for Snape. Also, Harry has no respect for Snape, because Snape hated his father and Sirius. When he found out that Snape's comments about his father being a bully were correct, he was upset about it.
We feel bad for Harry because of his life, the way he grew up. But I suspect Snape grew up in similar if not worse circumstances. Harry is a good looking boy, Snape was/is an unattractive ugly man. It's easy to hate him because of the way he looks and acts.
I don't believe JKR is going to make Snape a bad guy in the end, because she's taken so much time and effort for us to see him that way, and up to now, I don't get the feeling she's an obvious person. I think we are in for a surprise.