I believe that Hamlet had a true affection for Ophelia that may have been love or would have grown into true love had it not been for the chain of events that occurred. Several things happened that prevented Hamlet's love for Ophelia to come to full bloom. Hamlet was extremely distraught over the marriage of Gertrude to Claudius. Hamlet who I believe once had a great love and respect for his mother, is now horrified and betrayed by his mother's choice to marry so soon after his father's death. Not only is he upset over the hasty marriage, but he is also upset over the fact that she has chosen to marry his father's brother. Hamlet feels that this union is incestuous and goes against his religious beliefs. Hamlet also knows that Claudius killed his father and feels that his mother has defiled the memory of his father by marrying his father's murderer. The actions of his mother have made Hamlet distrust all women. If he did once love Ophelia he is now afraid to have any faith in her or any other woman because of his mother's actions.
I believe Hamlet is purposely cruel to Ophelia because he knows that in light of the present circumstances he cannot be with her. He is trying to protect her by running her away. Hamlet is also consumed with the apparent betrayal that surrounds him and when he asks Ophelia about the whereabouts of her father and she lies to him he is convinced that he cannot trust her and she is no better than his mother.
Upon hearing of Ophelia's death Hamlet does finally admit that he did love Ophelia and regrets that he could not freely admit or express his love for her.