Democrats are losing whites w/o a college diploma.
Look at the education gap between whites with a college degree vs whites without and their voting patterns.
In the 90s, the democrats did better among whites w/o a college degree (vs whites with). Then around the time of Bush the GOP started doing better among whites w/o a degree but it was only about a 10 point margin.
Then in 2016, the GOP did 35 points better among whites w/o a college degree because in 2016 whites w/o college jumped on the GOP bandwagon while whites with a college degree started leaving the GOP.
So considering that people with college degrees are more financially stable on average, what you say isn’t really true.
Also the GOP doesn’t win any racial demographic other than whites. So all the latino middle class, asian middle class, black middle class, indian middle class, etc are democrats.
Basically I don’t agree with your premise. The dems are not losing the middle class. They are losing whites who don’t have a college degree.
Also the GOP tend to be the party of in-groups and the democrats are the party of out-groups. In groups are men, whites, christians, native born Americans, heterosexuals, etc. The out-groups are everyone else.
So yes the democrats are the party of secularists and atheists. Those are outgroups. Democrats are also the party of muslims, hindus, new agers, sikhs, and pretty much any faith (or lack of faith) other than christianity.
Although the kind of christianity matters a little bit. Catholics are a little less republican than protestants. I wonder if that is because up until recently, catholics were also an out group (the KKK used to target catholics and the KKK was a protestant group for example).