Let $K$ be a complex quadratic number field such that $K(i)$ has class number $1$. If $K$ has class number $\ne 1$, then $K(i)$ must be the Hilbert class field of $K$, which, in this case, coincides with the genus class field of $K$. By genus theory, the discriminant of $K$ must have the form $d = -4p$ for a prime number $p \equiv 1 \bmod 4$.
In these cases, the ring of integers in $K$ is $R = {\mathbb Z}[\sqrt{-p}]$, and the ring of integers in $L$ is ${\mathbb Z}[i, (1 + \sqrt{p})/2] \ne R[i]$.
Finding number fields of higher degree with this property seems to be an interesting problem; I can't think of an obvious approach in general, but if I find anything, I'll let you know.
Edit 1. The argument works for all imaginary number fields: if $R$ is the ring of integers in a number field $K$, and if $S = R[i]$ is the ring of integers in the extension $L = K(i)$, then disc$(L) = \pm 4$ disc$(K)^2$ (this is a simple determinant calculation: take an integral basis $\{\alpha_1, \ldots, \alpha_n\}$ for $K$; then $\{\alpha_1, \ldots, \alpha_n, i\alpha_1, \ldots, i\alpha_n\}$ is an integral basis for $L$).
On the other hand, if $L$ has class number $1$ and $K$ is not a PID, then $K$ has class number $2$ and $L$ is the Hilbert class field of $K$. This implies disc$(L) = \pm$ disc$(K)^2$.
The problem in the non-imaginary case is that $K(i)$ might be unramified at all finite primes, but not at infinity; in this case, $K$ has class number $2$ in the strict sense, yet its ring of integers is a UFD.
Remark 2. By looking at $p = \alpha^2 + \beta^2$ modulo $4$ it follows (unless I did something stupid) that primes $p \equiv 3, 7 \bmod 20$ are not sums of two squares in ${\mathbb Z}[\sqrt{-5}]$.
Edit 2. Your suggestion to look at rings $R[\frac12]$, where $R$ is the ring of integers of a quadratic number field, seems to work for $K = {\mathbb Q}(\sqrt{-17})$, which has a cyclic class group of order $4$. The ring $R[\frac12]$ has class number $2$ because $2$ is ramified and so generates a class of order $2$, and $S = R[\frac12,i]$ is the integral closure of $R[\frac12]$ in the extension $L = K(i)$. The ring $R[\frac12]$ has class number $2$, and $S$ is a UFD since $L$ has class number $2$, and its class group is generated by one of the prime ideals above $2$ (the ramified prime above $2$ in $K$ splits in $L$).
Edit 3. The corollary concerning sums of two squares in $R[\frac12]$ shows that primes $p \equiv 3 \bmod 4$ splitting in $K$ are sums of two squares up to units. In fact it follows from genus theory that the prime ideals above such $p$ are not in the principal genus, hence lie in the same class as the prime above $2$ or in its inverse. This implies that either $2p = x^2 + 17y^2$ or $8p = x^2 + 17y^2$, giving a representation of $p$ as a sum of two squares up to a unit (remember $2$ is invertible). Thus everything is working fine.