The diminishing earning potential means there are more resources capable of fulfilling what role you're performing. Hoping to remain exclusive is not in the best interest of the field, is it?
I see relentless ageism as the result of the flood of new computer science talent. It biases recruiter expectations to seek out a certain type of candidate. Your experience as an older programmer is unique here and this could be an important opportunity for you to disrupt the status quo (eg. affect HR.)
Regarding lack of respect, I'm assuming you mean respect for the field of Computer Science? I think this is the result of the explosion in industry/applications of programming. Dollars drive attitudes, which has resulted in Ruby on Rails being the pinnacle of many programmers' fascination in computer science, as an example. Not that I dislike Ruby on Rails, of course!