This is a disturbing thread. The circumstances described by the OP should lead to the PD getting fired. However, we all know that isn't going to happen.
Have to disagree here. What would be the basis for firing him? I agree that what happened to the OP really sucks, but there is definitely part of the story we are not hearing, and may never hear. Unless you are trying to portray this PD as the villain in a black suit and tophat, twisting his long greasy mustache while trying to think of ways to screw with applicants, he has done nothing that deserves being fired. He had to have been just doing what he thought best for the program.
I imagine it basically went down like this. OP applies, looks good on paper, interviews, does well in interview, gets along with everyone. Program and PD would like to have him. OP sends email, is offered second look. During second look OP makes some faux pas/says something that ticks off resident/secretary/janitor/whoever. PD may have not known about it until afterward. Even if PD did know about it that day, whats he gonna do at that point, look you in the eye and say "well you totally screwed yourself today, best of luck." No, hes going to be polite. Saying "see you in July" was probably a bit over the top and certainly misleading, but at that point in the game I can see how the PD would just want to continue the process as usual and deal with whatever the issue was by not ranking the OP. Or, as I said before, perhaps the PD didn't even know about the issue until later, in which case the "see you in July" was sincere.
Alternate scenario, OP has done something at his/her home program that ticked somebody off. That somebody knows somebody else at the program in question. Ticked off guy paints OP in a bad light, word travels through the grapevine, OP isn't ranked.
Probably whatever the OP did wasn't even that big of a deal. But, having been on both sides of the interview table and then in debates about where to rank people, its amazing the stupid little BS that gets people blackballed. One offhand comment can rub someone wrong and totally screw you, even if you meant it one way and it was interpreted another way. Either way, there was obviously some red flag that popped up and you can't say that the PD should be fired when he's just looking out for his program.