Early computers had command line and other code-based interfaces (some of which survive today), and were operated by experts; it was only when personal computers began to be more common that a suitable visual metaphor for using one was needed. Many of the interface choices we take for granted today were created in direct imitation of a real, physical desktop from the pre-digital era, as a way of making interactions with the computer feel more natural.
The desk is still a familiar piece of furniture, and a real desktop really is just the top of a desk, on which you might put things like documents, folders, writing tools, an inbox and outbox, and other items now more familiar to many as icons.
The desktop as a computer interface has a long and complex history (including some short-lived, even more desk-like interfaces like Microsoft Bob), but we won’t get into that here. It’s simply worth pointing out that the computer is indeed an imitation desk, with a desktop you places papers and other things on. Mobile phones and tablets have largely abandoned this conceit, but even there vestiges remain if you look for them.