Down in the Dumps,
You did matter, and that is apparent in some of reactions that you are unfortunately experiencing as you prepare to leave. One thing you must know is that considering both this treatment and whatever compelled you to move elsewhere, you are probably moving to a much better "fit," as you inherently seem to know.
Parties, however, may not be the full measure of your value or importance. As mentioned in an earlier response, sometimes the people in charge of organizing parties in some departments are too busy, or unfortunately, may be more inclined to throw a party for one colleague but not another. If the second situation is your case, be happy in knowing that this is the kind of place you are
leaving.
All you did for your department is not wasted energy, but a foundation of work and accomplishments that you can take to your new place and build upon.
Take the friends and connections you have from this place (they may not be in your department), including the students, to heart. Do not respond to the "snubbers." They tend to relish drama and want to draw you down to their level. Those with professionalism and character will have a dialogue with you as an adult instead.
I agree with mdwlark about self-satisfaction and contentment in that . . .
you can't place your happiness, satisfaction, or self esteem in the hands of others.
Enjoy your new job.