A general result on absence of phase transitions in one dimension
Let me first state a very general result guaranteeing uniqueness of the infinite-volume Gibbs measure in one-dimensional systems, as this will show what the crucial assumptions are. To do this, I need to introduce some notations, so bear with me.
The spins $\sigma_i$, $i\in\mathbb{Z}$, can take values in an completely arbitrary set $E$. Given a particular configuration $\omega$ of the spins, the formal Hamiltonian reads
$$
H(\omega) = \sum_{A\subset\mathbb{Z} \text{ finite}} \Phi_A(\omega),
$$
where the sum is over all finite subsets of $\mathbb{Z}$ and the potential $\Phi_A$ depends only on the value of the configuration at the vertices of $A$.
Example: The Ising model on $\mathbb{Z}$ with long-range interaction corresponds to the choice $E=\{-1,1\}$ and
$$
\Phi_A =
\left\{
\begin{split}
-J_r\sigma_i\sigma_{i+r} & \quad\text{ if } A=\{i,i+r\}\text{ for some } i\in\mathbb{Z},\\
0 & \quad\text{ otherwise,}
\end{split}
\right.
$$
where the $J_r$ are the coupling constants (between two spins at distance $r$ from each other).
The theorem then takes the following form (see Theorem 8.39 in this book):
Suppose that the potential satisfies
$$
\sup_{i\in\mathbb{Z}} \sum_{\substack{A\subset\mathbb{Z}\text{ finite}\\\min A \leq \ell < \max A}} \delta(\Phi_A) < \infty,\tag{$\star$}
$$
where $\delta(\Phi_A) = \sup_{\omega,\omega'}|\Phi_A(\omega)-\Phi_A(\omega')|$. Then, the system admits at most one infinite-volume Gibbs measure.
This very general result provides widely applicable conditions guaranteeing the absence of first-order phase transition (i.e., uniqueness of the infinite-volume Gibbs measure). Essentially, the main assumption means that the total interaction energy between any two half-lines is bounded.
For instance, going back to the example above, it shows that the Ising model on $\mathbb{Z}$ with long-range interactions does not have spontaneous magnetization at any temperature, as long as $|J_r|<c r^{-\alpha}$ for some constants $c\geq 0$ and $\alpha>2$.
Some models with a phase transition in one dimension
The reason I provided the theorem above, in addition to its being much more general than what the heuristic free energy argument suggests, is that it also shows how counterexamples can be produced, by violating one or more of the assumptions. Let me discuss a few (superficially).
Interactions decaying too slowly. A first possibility is to violate condition $(\star)$. I'll only discuss this for the Ising model as above. One can prove in this case that, whenever $J_r \geq c r^{-\alpha}$ with constants $c>0$ and $\alpha\leq 2$, then there is a phase transition as $\beta$ is varied (with spontaneous magnetization at low temperatures). Note that, combined with the theorem above, this provides a complete picture for this model. This famous result is due to Dyson (when $\alpha<2$) and Fröhlich and Spencer (when $\alpha = 2$). The former uses a comparison with the Ising model on a hierarchical lattice, while the latter introduce a sophisticated version of the Peierls argument.
Unbounded potentials 1: inhomogeneous Ising model. We consider now a version of the nearest-neighbor Ising model on $\mathbb{Z}$, with
$$
\Phi_A =
\left\{
\begin{split}
J_{i}\sigma_i\sigma_{i+1} & \quad\text{ if } A=\{i,i+1\} \text{ for some }i\in\mathbb{Z},\\
0 & \quad\text{ otherwise,}
\end{split}
\right.
$$
where we now consider a collection of inhomogeneous coupling constants $J_i$; that is, the interaction between a spin at $i$ and its neighbor at $i+1$ varies with $i$.
Then (see this paper), there are multiple Gibbs states, provided that
$$
\sum_{i\in\mathbb{Z}} e^{-2|J_i|} < \infty.
$$
In other words, there is a phase transition whenever the energetic penalty for having $\sigma_i\neq\sigma_{i+1}$ increases sufficiently fast with $|i|$.
Unbounded potentials 2: unbounded spins. Another way of having unbounded potentials is to consider unbounded spins, for example $E=\mathbb{N}$ or $E=\mathbb{Z}$. As this post is becoming pretty long, I won't provide a precise description of such examples, but instead refer to Chapter 11 of Georgii's book for a detailed discussion of several of them, all with nearest-neighbor interactions.
Let me also mention that the existence of phase transitions in one-dimensional systems of unbounded spins should not come as a surprise. Indeed such models can be used, for instance, as effective description of interfaces in two-dimensional systems, and it is well known that such interfaces can undergo phase transitions (pinning, wetting, etc.). A classical reference for this type of things is this paper (in particular Section 6).
I stop here, but other examples can be found, for instance, in this paper.
Concluding remarks
The general theorem stated above excludes the existence of multiple Gibbs states (thus, in particular, the existence of a first-order phase transition with respect to some external field), but lets open the possibility of having other types of phase transitions. There exist results showing that one-dimensional models, under stronger conditions, have a free energy that is analytic in the parameters of the Hamiltonian. One such result (assuming finite-range interactions) can be found in Ruelle's famous book (see Theorem 5.6.2).