Silicon Valley looks like a cross between Milton Keynes and the set of the Stepford Wives. Row after row of ordinary houses and picket fences, clustered in villages notable only for the mega-companies they serve: Menlo Park (Facebook), Cupertino (Apple) or Mountain View (Google). There’s the odd charm, but it’s generally clean, sterile, young, overpriced. Life here, they say, is five years ahead of everywhere else. Well, if that’s the case, I’ve seen the future and it is a bit disturbing.

The surface ordinariness of the Valley hides a deep utopianism. In the late 1960s San Francisco was the home of both hippie counterculture and the early computer communities. Both groups shared an aversion to the existing order. For the early techies, digital technology was a means with which to escape the rules and regulations of overbearing governments and build a better world.

The big-tech firms see themselves as heirs to this emancipating counterculture, despite the fact that they are now among the most powerful and richest companies in the world. You hear the utopianism in the visions of Silicon Valley’s leading lights: to organise the world’s information, to connect every single person, to end ageing, etc. Silicon Valley tells itself it is not just about money: it’s about improving the world.

Even altruistic visionaries need money to survive, so they scramble after investment, which is on tap from wealthy venture capitalists. But investment brings new responsibilities: profit margins, quarterlies, insane growth targets. That drives an old-fashioned ruthless capitalism which lies just beneath the beanbags and T-shirts veneer. The meeting of techno-utopianism and profit-making is an unstoppable force, and it has a dark side. One result is that it is creating two almost entirely separate worlds.

Firstly, there is the Silicon Valley for the tech workers. A quarter of the workforce — approximately half a million people — work in the ‘innovation industry’, as they call it. Even the typical tech worker can quickly expect to be earning well over $100,000 a year. For the biggest companies, the median salary is more than $150,000. These professionals, who are mostly under 40, want to live in bustling San Francisco. So each morning they hop on to a private wifi-enabled coach from one of the dozens of pick-up points in increasingly gentrified streets, and head down freeway 101 into Menlo Park or Cupertino or Mountain View. There they pass the day working in the cool workspaces packed with other creatives and innovators making the world a better place, looking constantly for other industries to ‘disrupt’. It’s thrilling and full of purpose.

One by-product of this disruptive tech sector is the second Silicon Valley. It’s a place where minorities struggle on low-wage jobs, serving the largely white affluent tech guys. The medium house value in San Francisco is now more than a million dollars, and average rent is more than $4,500 per month for a two-bedroom apartment. This is beyond the reach of nearly everyone — but not the tech workers. (In 2015, the median per capita income in San Francisco was $57,000 — for Hispanics or Latin Americans it was almost half that.) According to Rebecca Solnit, a San Franciscan writer and long-time resident, money and gentrification are crushing the spirit of the place. ‘There’s no more time for idealism in San Francisco any more,’ she told me as we wandered through the Haight-Ashbury district. It used to be a place for radicalism, alternative ways of life. But now everyone’s too busy working, commuting or being priced out. ‘I have no idea what’ll happen, but it feels like things are just falling apart,’ Rebecca said.

The first thing that strikes most visitors to San Francisco is the very visible homelessness problem. There are 7,500 homeless people on the streets. Double that are registered homeless — one of the highest per capita in the country. This has been a long-standing problem in San Francisco (and much of California — and its causes are complex), but locals here say it’s never been this bad. Perhaps it’s the contrast that’s the problem: there are parts of this glorious metropolis that reek of used needles, human waste and food banks, sometimes in the shadows of the world’s biggest and coolest companies. One morning I saw people openly shooting up on a busy street: it wasn’t yet 9 a.m.

Silicon Valley does not consider itself responsible for creating these problems. People always complain when places are gentrified; and many of San Francisco’s problems are the usual ones for big cities — housing shortages, transit overloads, struggling public services, key workers being priced out. The tech workers don’t have malign intent. But the animating philosophy of Silicon Valley is to ‘move fast and break things’ — as the Facebook motto goes — and to drive restlessly toward innovation and efficiency. And because most people here really believe they are doing good, they rarely stop to check for side effects. Perhaps Airbnb’s warm vision of allowing people to ‘feel at home in every city in the world’ justified its decision to behave, according to local supervisor Aaron Peskin, in a way that’s more ruthless and arrogant than any other business in San Francisco. Perhaps Google’s desire to ‘do no evil’ justified its breach of EU competition law. Perhaps Uber’s car-sharing environmentalism encouraged its heads to use slightly sinister psychological tools to squeeze every drop of productivity out of its drivers.

Most tech business don’t need huge factories and thousands of mid-level employees — they need lines of code, algorithms and highly skilled teams. That’s why Facebook, worth hundreds of billions, only has around 12,000 full-time staff. At its peak General Motors was worth half that, and employed almost half a million people. This creates what MIT economist David Autor calls a ‘bar-bell shaped economy’: well-paid knowledge economy jobs at the top end of the market, and loads of low-paid service sector jobs at the bottom. The middle, such as trucking, manufacturing, journalism and logistics, is withering away. Most of the new non-tech jobs are in the service industry, where wages are very low, and that is contributing to the affordability crisis for all but the very well-off.

Being disruptors, tech firms have a fractious relationship with regulators. All property owners in Silicon Valley pay an annual tax based on the value of their property. Measuring and extracting that tax falls to Larry Stone, the septuagenarian county assessor of Santa Clara County, who I interviewed recently as part of the BBC Series The Secrets of Silicon Valley. ‘It’s like a game of cat and mouse with Apple,’ he told me recently, as he showed me Apple’s newly built headquarters. Larry’s team assessed the value of all Apple’s property in his catchment area to be around $7 billion. But Apple disputed 99 per cent of Larry’s assessments, filing that their properties were worth a mere $57 million. If Apple wins the appeal — which Larry assures me they will not — it would reduce the most valuable company in the world’s tax bill by $70 million. Even if they don’t, taxpayers have to foot the bill for the tussle, which is doubly frustrating when you look at the state of Silicon Valley’s roads, or San Francisco’s homelessness problem, or its schools, where Hispanic and Latino students made up more than a third of 11th-grade test takers in Silicon Valley last year, and where 80 per cent did not meet state standards in maths.

Not everyone is as bad as Apple, said Larry. Facebook, for example, are far more compliant and community-minded. But Larry fears that the area might turn into a modern-day Detroit: the city that was once the envy of the world, now bankrupt. ‘Everything happens much faster here,’ he said. ‘We could go the same way, if we don’t come together as a community.’

Right now, the Silicon Valley geniuses are hard at work on the next wave of changes to which we’ll need to adapt over the next five to ten years: artificial intelligence, self-driving cars, robotics and automation. It remains to be seen if these are job-creating fields: many analysts think it’s quite the opposite. It seems highly likely that the newest technologies will only exacerbate Silicon Valley’s cruel dichotomy: a beautiful, hip utopia for some, a struggling dystopia for others.

By the time we realise, it will be too late to do anything about it. The disruptors will have moved on to the next exciting technology, and we’ll be too hooked on the possibilities to bother.

The meeting of techno-utopianism and profit-making is an unstoppable force, and it has a dark side

Jamie Bartlett presents the BBC Two Series The Secrets of Silicon Valley on Sunday at 8pm.