Why is the Turing machine rather than the finite automaton the main model for computation if computers have finite memory?

Any physical computational device clearly has finite memory. On the other hand the input can be external and could therefore potentially be infinite. This idea is perfectly captured by the deterministic finite automata (DFA), so why do we use the Turing machines instead?

Let's consider a popular example. The language $$L = \{a^nb^n, n\in \mathbb{N} \}$$ is recognizable by a Turing machine, but not by a DFA. Suppose that you are getting a string from a server, and you need to determine whether it belongs to $$L$$ or not. I'd say you can't do it, because you might, in fact, run out of memory.

Usually unless specified otherwise for some purpose, we do not consider TM inputs to be infinite, only unbounded in length (similar to DFA input strings, as a normal DFA cannot accept or reject a string that never ends). This distinction might be hard to grasp, but it will be useful. If you're curious, you can read up on $$\omega$$-automata, a class of automatons specifically modeling problems with infinite-length inputs.