End of the line, as outlined by Manifest Destiny - there's no where left to go for those traveling West as they have been since folks started swarming across the Atlantic to get here. Of course California has a higher concetration of poor, as well as far more middle class and wealthy then anywhere east of the Northeast. What part of 40 million (that you yourself pointed out) out of 327 million did you not understand?
And surprise, just like Okies looking for a better future, foreigners congregate there because Pig Scrotum Iowa (pop 305, oops, make that 304) for some curious reason lacks the pizzaz as well as any reason for anyone wanting to actually do something with their lives other than driving 78 miles per day to participate in Walmart Culture when not staring at disappearing corn fields to go live there.
You also neglected to mention the percentage California pays into Federal taxes, funding those excrementitious do-nothing invisible States people have to drive through to get to civilization AKA the West and Northeast coasts.
And then there's the big one - 20% - TWENTY - of what is the economy of Planet Earth which just so happens to be generated coincidentally where it's located in its home in the World's 5th largest economy - FIFTH - in a place otherwise known as California.
Jealousy is so unbecoming, but in this case given the demographic, understandable.