I'm still very much a novice in algebraic geometry, but as far as I know, when one views the elements of a ring $R$ as "functions" on $\text{Spec}(R)$, this is not from the point of view of preserving any structure. In fact, they aren't actually functions per se, since the "value" of $f\in R$ at $p\in\text{Spec}(R)$ is $\overline{f}\in\kappa(p)$, and the field $\kappa(p)$ can vary as $p$ varies. One reason that viewing $R$ as "functions" on $\text{Spec}(R)$ is useful (besides the fact that it generalizes the case of a variety $X$, when all the $\kappa(p)$'s are $\mathbb{C}$, and the elements of the coordinate ring $A(X)$ are actually functions) is that it motivates the definition of a morphism of affine schemes $f:\text{Spec}(S)\rightarrow\text{Spec}(R)$ to be a map such that we can "pull back" "functions" on $\text{Spec}(R)$ to "functions" on $\text{Spec}(S)$ (i.e., send elements of $R$ to elements of $S$, i.e. have a homomorphism from $R$ to $S$, which we know is in fact equivalent to a map of schemes from $\text{Spec}(S)$ to $\text{Spec}(R)$). By analogy, a map of manifolds $f:M\rightarrow N$ is smooth iff for any smooth function $g:N\rightarrow\mathbb{R}$, the pullback $g\circ f$ is a smooth function on $M$.
So I think that $R$-as-functions-on-$\text{Spec}(R)$ should really be considered as something special, and inherent to the structure of $\text{Spec}(R)$ (specifically, this is the structure sheaf), and that this then motivates the definition of a morphism of schemes as something which preserves that.
EDIT: Oh, I should also mention a neat idea from Eisenbud + Harris that also motivates the "function" analogy: 