WordPress cannot write files to the wp-content/themes folder. The core code checks write access before installing or updating a theme. When the check fails, WordPress stops the operation and shows an error.
The failure usually results from the operating system blocking the web‑server user. Permissions, ownership, security policies or a read‑only mount prevent PHP from creating or modifying files in the theme directory.