I agree that it was very unprofessional of them to ask you to interview when it sounds like they had already made another choice. They lost in this case, because you probably were the best for the job since you had been there before. Keep looking - the next job will be better.