Here's an example from number theory. In the ring $R = \mathbb{Z}\lbrack\sqrt{-5}\rbrack = \{a + b\sqrt{-5} : a,b \in \mathbb{Z}\}$ is not a PID! Specifically, the ideal $I = (2,1+\sqrt{-5})$ is not principal.
The easiest way to see this is to use the norm map $N: \mathbb{Z}\lbrack\sqrt{-5}\rbrack \to \mathbb{Z}$ defined by $N(x+y\sqrt{-5}) = (x+y\sqrt{-5})(x-y\sqrt{-5}) = x^2 + 5y^2$. This map is well-defined and multiplicative ($N(rs) = N(r)N(s)$ for $r,s \in \mathbb{Z}\lbrack\sqrt{-5}\rbrack$).
Multiplicativity implies that if $z = xy$ then $N(z) = N(x)N(y)$ and so $N(x), N(y) \mid N(z)$ (since $N(x)$, $N(y)$, and $N(z)$ are all integers).
Now onto the proof.
First, notice that $1 \not\in I$, and so $I$ is a proper ideal of $R$. By way of contradiction, assume that $I = (\alpha)$ for some $\alpha \in R$. Then $\alpha \mid 2$, $\alpha \mid (1+\sqrt{-5})$. Hence by the above observation about the norm map we know $N(\alpha) \mid N(2) = 4$ and $N(\alpha) \mid N(1+\sqrt{-5}) = 6$.
Hence $N(\alpha) \mid \text{gcd}(4,6) = 2$, which (since $N(\alpha) \geq 0$) makes $N(\alpha) \in \{1,2\}$. But we know $\alpha = a + b\sqrt{-5}$ for integers $a,b$ and $N(\alpha) = a^2+5b^2$. The equation $a^2 + 5b^2 = 2$ has no solutions $(a,b)$ in $\mathbb{Z}^2$, and the only solutions $(a,b)$ in $\mathbb{Z}^2$ to $a^2 + 5b^2 = 1$ are $(a,b) = (\pm1,0)$. Thus $\alpha \in\{\pm 1\}$ is a unit, which means $I = (\alpha) = R$. But we've already noted above (and it's easy to very directly) that $1 \not\in I$, and so this is a contradiction.