Maybe I can say something useful here. The main confusion seems to be how to find the sheaves/ideals/modules associated to multiples of divisors. As Martin Bright points out, symbolic power of a prime ideal is one way to find this, but there are others.
Symbolic powers
Given a prime ideal $P \subseteq R$ (or an intersection of prime ideals $\cap_i P_i$) one can form $P^n$ for every $n$ (or $(\cap_i P_i)^n$). The elements of this ideal certainly vanish to order $n$ along $V(P)$ but perhaps surprisingly, there can be other elements that vanish to order $n$ as well.
As you have already pointed out, in your example $S$, the element $X$ vanishes to order 2 along $D$ even though it is not in $(X,Z)^2$ (I guess your statement about Zariski neighborhood's maybe handles this difference). The way this is handled via commutative algebra is via something called symbolic powers.
Let $R_P$ denote the localization of $P$. Note if $f \in R$ vanishes to order $n$ along $V(P)$ this means that $f \in (P R_P)^n$.
Definition: The $n$th symbolic power of $P$ is defined to be $P^{(n)} = (P R_P)^n \cap R$. The $n$th symbolic power of $\cap_i P_i$ is defined to be $\cap_i P_i^{(n)}$.
Alternately, one can write
$$P^n = \cap_i Q_i$$
where the $Q_i$ are a primary decomposition of $P^n$. Then there is a unique $P$-primary component of that intersection, say $Q_1$ (see a commutative algebra book). It follows that $P^{(n)} = Q_1$. One can do something similar for the $\cap_i P_i$.
Symbolic powers are still a very active area of study within commutative algebra. One particular area of study is when are they equal to ordinary powers? For instance, this is known if $P$ is defined by a regular sequence and a few more cases. See Eisenbud's book for some discussion (or search the arxiv for symbolic power).
Example: For fun, try computing the second symbolic power of $\langle x,y \rangle \cap \langle x,z \rangle \cap \langle y,z \rangle \in \mathbb{Q}[x,y,z]$. You will see it is also different from the square.
S2-ification
Now suppose that our $P$ is (or $P_i$'s) are all height 1 and further suppose that $R$ is a normal domain.
As we mentioned, the reason that $P^n$ isn't equal to the symbolic power is that $P^n$ has some higher embedded primes in its primary decomposition.
Anyway, it's not hard to see that a finitely generated module $M$ is S2 if and only if it satisfies Hartog's phenomena (see the excellent answers by Sándor Kovács HERE). In other words, if $X$ is $\mathrm{Spec} R$, and $Z \subseteq X$ is of codimension 2, then $H^0(X, \tilde M) = H^0(X \setminus Z, \tilde M)$. Hence one can construct the S2-ification of a module by finding a sufficiently big codimension-2 subset $Z \subseteq X$ and computing $H^0(X, \tilde M)$.
Under the hypotheses above, the S2-ification of $P^n$ is exactly the symbolic power (choose as $Z$ the set where the embedded $Q_i$ vanish).
Remark: Of course, if you choose the $P_i$ like in the example at the end of the Symbolic power section, the S2-ification will just give you $R$ (since you could choose your $Z$ to be the $V(\cap_i P_i)$).
Reflexification
Suppose again that our $P$ is (or $P_i$'s) are all height 1 and that $R$ is normal.
There is a functor from $R$-modules to $R$-modules
$$M \mapsto \mathrm{Hom}_R(\mathrm{Hom}_R(M, R), R)$$
which sends to its $R$-reflexification (note, one can also reflexify against the canonical module which can do something different in the non-normal case).
Anyway, it's not hard to see that $\mathrm{Hom}_R(\mathrm{Hom}_R(P^n, R), R)$ is S2 and in fact is equal to the S2-ification (note that in codimension 1, $P^n$ is principal, and so the reflexification operation does nothing).
Divisor definition
The definition of Weil divisor that I like best (including in the non-normal case) is as follows. Note that this doesn't necessarily coincide with your definition of Weil divisor as a sum of height primes.
Definition: A Weil divisor on a Noetherian ring (frequently S2) $R$ is an S2 subsheaf of $K(R)$ that
- Agrees with $K(R)$ after localizing at every height-0 prime of $R$ and
- Is principal after localizing at every height 1 prime of $R$.
A Weil divisor is Cartier if it is principal. Given a Weil divisor $D$, we define $nD$ to be the S2-ification of $D^n$ and so define a divisor to be $\mathbb{Q}$-Cartier if $nD$ is Cartier.
Frequently the second condition is left out in the literature. One can also call such things Weil-divisorial sheaves or Almost Cartier Divisors.
Caveat: The definition I like working with is the one that works for my applications. This doesn't mean that it is the right definition for other applications, and so there are other definitions one can make too! (Hopefully they all coincide in the case of a normal domain $R$).
References
There is a nice paper by Hartshorne Generalized divisors in Gorenstein rings and also see Generalized divisors and biliason, which addresses all this in greater generality than I described here. As mentioned, Eisenbud's book on commutative algebra also contains some of this information (especially the symbolic power stuff). From the point of view of the minimal model program, there is a chapter on this in Flips and Abundance for Algebraic Threefolds.
Best Answer
In the setup in the question, it should really say "we could have invertible meromorphic functions on Spec($A$) that don't come Frac($A)^{\times}$", since those are what give rise to "extra principal Cartier divisors". This is what I will prove cannot happen. The argument is a correction on an earlier attempt which had a bone-headed error. [Kleiman's construction from Georges' answer is not invertible, so no inconsistency. Kleiman makes some unfortunate typos -- his $\oplus k(Q)$ should be $\prod k(Q)$, and more seriously the $t$ at the end of his construction should be $\tau$, for example -- but not a big nuisance.]
For anyone curious about general background on meromorphic functions on arbitrary schemes, see EGA IV$_4$, sec. 20, esp. 20.1.3, 20.1.4. (There is a little subtle error: in (20.1.3), $\Gamma(U,\mathcal{S})$ should consist of locally regular sections of $O_X$; this is the issue in the Kleiman reference mentioned by Georges. The content of EGA works just fine upon making that little correction. There are more hilarious errors elsewhere in IV$_4$, all correctable, such as fractions with infinite numerator and denominator, but that's a story for another day.) Also, 20.2.12 there is the result cited from Qing Liu's book in the setup for the question.
The first step in the proof is the observation that for any scheme $X$, the ring $M(X)$ of meromorphic functions is naturally identified with the direct limit of the modules Hom($J, O_X)$ as $J$ varies through quasi-coherent ideals which contain a regular section of $O_X$ Zariski-locally on $X$. Basically, such $J$ are precisely the quasi-coherent "ideals of denominators" of global meromorphic functions. This description of $M(X)$ is left to the reader as an exercise, or see section 2 of the paper "Moishezon spaces in rigid-analytic geometry" on my webpage for the solution, given there in the rigid-analytic case but by methods which are perfectly general.
Now working on Spec($A$), a global meromorphic function "is" an $A$-linear map $f:J \rightarrow A$ for an ideal $J$ that contains a non-zero-divisor Zariski-locally on $A$.
Assume $f$ is an invertible meromorphic function: there are finitely many $s_i \in J$ and a finite open cover {$U_i$} of Spec($A$) (yes, same index set) so that $s_i$ and $f(s_i)$ are non-zero-divisors on $U_i$; we may and do assume each $U_i$ is quasi-compact. Let $S$ be the non-zero-divisors in $A$. Hypotheses are preserved by $S$-localizing, and it suffices to solve after such localization (exercise). So without loss of generality each element of $A$ is either a zero-divisor or a unit. If $J=A$ then $f(x)=ax$ for some $a \in A$, so $a s_i=f(s_i)$ on each $U_i$, so all $a|_{U_i}$ are regular, so $a$ is not a zero-divisor in $A$, so $a$ is a unit in $A$ (due to the special properties we have arranged for $A$). Hence, it suffices to show $J=A$.
Since the zero scheme $V({\rm{Ann}}(s_i))$ is disjoint from $U_i$ (as $s_i|_ {U_i}$ is a regular section), the closed sets $V({\rm{Ann}}(s_i))$ and $V({\rm{Ann}}(s_2))$ have intersection disjoint from $U_1 \cup U_2$. In other words, the quasi-coherent ideals ${\rm{Ann}}(s_1)$ and ${\rm{Ann}}(s_2)$ generate the unit ideal over $U_1 \cup U_2$. A quasi-coherent sheaf is generated by global sections over any quasi-affine scheme, such as $U_1 \cup U_2$ (a quasi-compact open in an affine scheme), so we get $a_1 \in {\rm{Ann}}(s_1)$ and $a_2 \in {\rm{Ann}}(s_2)$ such that $a_1 + a_2 = 1$ on $U_1 \cup U_2$. Multiplying both sides by $s_1 s_2$, we get that $s_1 s_2 = 0$ on $U_1 \cup U_2$. But $s_1$ is a regular section over $U_1$, so $s_2|_ {U_1} = 0$. But $s_2|_ {U_2}$ is a regular section, so we conclude that $U_1$ and $U_2$ are disjoint. This argument shows that the $U_i$ are pairwise disjoint.
Thus, {$U_i$} is a finite disjoint open cover of Spec($A$), so in fact each $U_i = {\rm{Spec}}(A_i)$ with $A = \prod A_i$. But recall that in $A$ every non-unit is a zero-divisor. It follows that the same holds for each $A_i$ (by inserting 1's in the other factor rings), so each regular section $s_i|_ {U_i} \in A_i$ is a unit. But the preceding argument likewise shows that $s_i|_ {U_j} = 0$ in $A_j$ for $j \ne i$, so each $s_i \in A$ has a unit component along the $i$th factor and vanishing component along the other factors. Hence, the $s_i$ generate 1, so $J = A$. QED