Linda, it's probably because you didn't point out to the official that you visa was still valid. I don't think it matters if your entry and exit points are different.
The last time I visited my visa was still valid from a previous trip and when I handed over my passport I was told that I had to get another visa but I stood my ground and pointed out the dates. The officer then smiled and allowed me through. I expect they're on a profit share scheme!!