I was born and raised in Palo Alto and I go to UC Berkeley now. I spend a lot of time in SF. A lot of what you said relates to my childhood. But a lot of what happened was the result of my choices. I love technology and I love the culture here. One thing that helped me before going to college was taking a year off to work, which really helped me figure out what was important to focus on and what isn't important (not important = grades. important = meeting people). Now that I'm in college, I could easily choose to party all the time and slack off. But that's just not me. Plus, I've had fun at parties/kickbacks in SF before.
As a side note. I use "Silicon Valley" to refer to the SF Bay Area (SF + East Bay + geographic SV). To me, Silicon Valley is a term for the entire technology region, much like "LA" describes the metropolitan LA area, and "Wall Street" describes NY finance in general.