Schools are jeopardising the career prospects of thousands of teenagers by failing to offer compulsory classes in computing, a damning report by inspectors shows.

A three-year study by Ofsted found that in almost a fifth of secondary schools, up to half of 14- to 16-year-olds are not taught computing – known as Information and Communication Technology (ICT).

The subject is compulsory for children aged five to 16 and is seen as crucial to rebuilding of the economy.

Inspectors denounced the quality of teaching in the subject as inadequate in more than a quarter of secondary schools.

Too many ICT teachers have limited knowledge of key skills, such as computer programming, they said.

High-flying students are often not stretched and their interests in the subject are ignored, while many pupils spend computing lessons repeating tasks asked of them a year ago.

In half of all secondary schools, the level many school-leavers reach in ICT is so low they would not be able to go on to advanced study, a technician-level course or an apprenticeship in computing or a related subject. Achievement in ICT in sixth-forms is "highly variable".

The inspectors based their assessments on visits to 74 secondary schools in England. Their report – ICT in schools 2008 to 2011 – comes as the place of computing in the curriculum rises up the national education agenda.

The government is expected to publish its technology strategy for schools in the new year. Michael Gove, the education secretary, has acknowledged that computer science is not taught widely enough in schools.

In August, the chairman of Google, Eric Schmidt, attacked the UK for failing to capitalise on its record of innovation in science and engineering. He said the country that invented the computer was "throwing away your great computer heritage" by failing to teach programming in schools.

David Cameron later said Schmidt was right and admitted that Britain was not doing enough to teach the next generation of programmers.

There has been a dramatic fall in the number of pupils taking a GCSE in ICT over the last four years. In 2011, 31,800 pupils took the GCSE, compared to 81,100 in 2007. At the same time, there has been a steep rise in the number of pupils taking vocational courses in computing.

Ofsted also visited 90 primary schools for its report. Pupils' achievement in the subject and the quality of teaching in ICT are generally much better in primary schools than secondaries, the inspectors found.

In one in eight primary schools, pupils' achievement was outstanding. Some primaries had set up before-school clubs where parents and children could develop their computing skills.

However, in just over a third of primary schools teaching and learning were satisfactory or worse and in some primary schools, teachers lacked the expertise needed to instruct pupils in how to use spreadsheets.

The inspectors said few schools – primary and secondary – were engaging with local IT firms.

"The ICT curriculum and range of qualifications provided by many of the secondary schools ... [are] not adequately preparing students either for more advanced academic courses in ICT and related subjects, or for technician-level further education and apprenticeships," the report states. Too often, teachers underestimate what pupils are capable of achieving, it said.