Your question is best thought of as: why is a process usually patentable (if innovative and nonobvious and meeting several other conditions) but an algorithm never is? This question is especially perplexing as a process and an algorithm are substantially similar concepts: a sequence of steps is at the heart of both of them.
A process is a sequence of steps to produce a result within a specific domain of application. An algorithm is a sequence of steps to produce a result universal to all domains of application that need such a result. This is the key difference that makes a difference to patentability. The definition of process there is known in logic as existential instantiation. The definition of algorithm there is known as universal generalization. Generally, WIPO-signatory jurisdictions do not permit patenting any form of universal generalization, whether that be a principle of nature (because it spans potentially-numerous application domains), a mathematical principle/theory/lemma/corollary (because it spans potentially-numerous application domains), or an algorithm as a generalized/generic process (because it spans potentially-numerous application domains). Conversely, generally, a utility patent must focus on one specific application-domain.
As such, an algorithm (e.g., the procedure of calculating arithmetic-mean/average) likely can be patented if arithmetic mean is novelly applied to a specific application domain for which it never has been applied before, such as load-balancing something within a brand new kind of quantum computer. This is analogous to knurles being able to be patented decades ago as an incremental improvement on a paper clip, despite knurling being a previously-existing metal-working practice. The entirety of knurling all shapes of all metals was not patented, but rather knurling only steel-alloys that are bent into the paper-clip shape as an improvement in the specific application of increasing friction of the paper clip against paper. Some other inventor was still free to patent knurling of, say, some new kind of tool handle or some new toilet bar for handicapped people or some new kind of otherwise slippery key into some lock; patenting knurling of paperclips did not forestall the application of the generalized principle of knurling to other application domains. In this line of thinking, arithmetic mean itself (i.e., the “itself” there means “per se“) is not what is being patented; the cleverly-innovative application (i.e., logic's existential instantiation) of the generalized (i.e., logic's universal generalization) principle to a fresh topic is what is being patented for only 1 specific application-domain: the algorithm of arithmetic mean as applied to load-balancing something in that fresh kind of quantum computer nowadays, which does not forestall patenting arithmetic-mean-based load balancing in some other application domain, nor does it forestall some non-load-balancing usage of arithmetic mean in still other application domains.