Let $R$ be a UFD, and let $I$ be an ideal of $R[T]$ ($T$ is a variable over $R$). Assume that $\frac{R[T]}{I}$ is a flat $R$-module.
The following claim and its proof appear in the comments to this question.
Claim: If $I$ is proper, then $I$ is principal.
Proof: Let $A=R[T]$, then $A$ is also a UFD, since $R$ is. So, any ideal $I=Jf$ where $J$ has height at least two. We wish to show that if $A/I$ is $R$-flat, then $J=A$. If not, you have an exact sequence, $0 \rightarrow A/J \stackrel{f}{\rightarrow} A/I \rightarrow A/fA \rightarrow 0$. But, height of $J$ is at least two implies $J \cap R \neq 0$. Then, for any $0 \neq a \in J \cap R$, we get $A/I \stackrel{a}{\rightarrow} A/I$ is non-injective, contradicting flatness. Thus $J=A$ and then $I=fA$, a principal ideal.
Question: Why any ideal $I$ of $A$ is of the form $I=Jf$, where $J$ is an ideal of $A$ of height at least two and $f \in A$.
Another proof of the claim, based on a result of Ohm and Rush: It seems that the above claim can be proved also by a result of Ohm and Rush, Corollary 1.3, which says the following: $\frac{R[T]}{I}$ is $R$-flat if and only if $I$ is an invertible ideal and $c(I)=R$.
So we should show that an invertible ideal of $R[T]$ is a principal ideal of $R[T]$; this is indeed true since in a GCD domain, invertible ideals are principal, and of course a UFD is a GCD domain, see this question.
Notice that in the paper of Ohm and Rush $R$ is just a commutative ring, not necessarily an integral domain. Invertible ideals in integral domains are dealt with in this book of Zariski and Samuel, for example.
Thank you very much.