Why did the gold rush attract so many people to California?
Obviously, because there was gold there and they wanted some of it. This was augmented by the fad like nature of the Gold Rush. Many people were attracted by the "everyone is doing it" aspect.
While a few people got rich by finding gold, but more people got rich by selling supplies to the ones looking for it.
The thought of getting rich did attract many, but another big reason was the chance for freedom. California wasn't yet a state and laws weren't particularly enforced. There was no established society except for those of the Native Americans, so people could basically create their own.