Good friends with your ex

Can you remain good friends with your ex, even when you get married?

I am very good friends with my ex, he checks up on me every day and we speak very often. He tells me what's going on with his life and I do likewise... I don't see anything wrong with that. However, my friends are telling me that I am disrespecting my husband by still talking to my ex??? My ex is in a different country and we were best friends before dating! I have known him for ten years. I really don't understand why I should be enemies with someone who means absolutely no harm to me or my marriage, just because I am now married. What are your thoughts please