Jobs. Tons of them, in many areas of software and hardware engineering. Plus, the network effects cannot be underestimated -- opportunities for career networking, meetups, conferences, etc. are enormous. After a few years here, you will have former coworkers at other tech companies who can help you advance in your career.
If you lose your job, or your company fails, you won't have to move to find another job -- there will be plenty of other companies to work for. Taking a job at a startup is therefore not a huge risk. Buying a home here, and thereby tying yourself down to this area, is unlikely to hold you back in your career, as it might elsewhere -- you will probably never need to move in order to achieve advancement in your field.
There is also the presence of venture capital. The VC world is very Silicon Valley-centric, although that might be changing. If you want funding, you'll have to come here for it. If you want to take advantage of your investors' professional networks to find other investors and build your team, you'll have to hire people who live here and don't want to leave.
As a result of these network effects, many of the world's best software engineers choose to live here, and companies want to be here to hire them. There is now a saying in the startup world that you can start your company anywhere, but Silicon Valley is the best place to grow it, because the pool of engineering talent here is larger than it is anywhere else.
Plus, this is a very nice place to live, if you can afford it.
Despite some of the exaggerations many people are making in this thread, I know quite a few people who have purchased homes and condos in the past few years, including someone who bought one this week on a salary well under $200k -- without any help from his parents or anyone else. I think the highest price any of them paid was about $700k, which is well under some of the numbers people are quoting here. It's doable for a single person who has a high income, and it is easily doable for married couples who work in tech or are successful in other fields. The main barrier to ownership is the down payment, not the mortgage payments.
Renting is also not as bad as people say it is, unless you live in downtown San Francisco. I pay less than $2k per month for a decent apartment in a very good location near a train station and major freeways, and I could spend less if I wanted to. My commute is quite pleasant. My rent probably sounds high to people from other cities, but on an average software engineer's salary, it is not burdensome in any way.