When I was in school, a typing/keyboarding class was a pre-req for the computer classes. It was not at all necessary, I did not _actually_ learn to touch-type until a decade later, and at that point I did it because I decided it was stupid to be looking at the keyboard when I should be looking at the code. But, you know, thank goodness I got to waste that semester on something which was basically useless and which was trivial to learn once I decided I needed it.
Later, the "computer" classes in school had a strong dollop of learning how to use a word processor of spreadsheet. Which may be valuable vocational skills, but they were like a "Math for Living" class when the people forcing everyone to take them thought they were getting "Algebra II".
Even later, it was how to create a webpage. Because HTML is certainly the future and we'll never have WYSIWYG tools to do the heavy lifting to let consumers build webpages easily.
And that's in primary and secondary levels. You can get college-level "Computer Science" degrees having only demonstrated the ability to wire other people's code together. Again, a valuable vocational skill, but _not_ computer science.
I'll give you two opinions about why this happens. First, being able to write code is no more nor less useful than being able to fix plumbing - when it's useful, it's wicked useful, but if that's not your job, you'll probably never develop enough expertise to solve problems you actually see, as opposed to hypothetical classroom problems. Second, the instructors at the primary and secondary level generally don't themselves have enough understanding of the topic to be able to successfully teach it. Which isn't a bad thing, because as I said, it's not a worthwhile thing for most people to develop an understanding of the topic.
Of course, in the end this isn't really much different from many other topics taught in schools. Most people don't ever need to analyze a work of fiction, or calculate the remaining angle in a diagram from the given angles. A big difference is that geometry in 2050 is going to be very similar to geometry in 1750, so you can productively teach the skill based on hundreds of years of doing it, and insofar as it is useful at all, it will continue to be useful. Most of the vocational computer-related stuff they teach today didn't exist 10 or 20 years ago, and much of it won't be useful in 10 or 20 years. The decades-old stuff which is still useful to me as a professional is the esoteric knowledge, not the applied knowledge.