What are the conditions for an ionosphere to form?
Most of the visible matter in the universe consists of ionized matter (I'm citing thise from the publicly available lectures from R. Fitzpatrick and the monograph from J.A. Bittencourt - Introduction to plasma physics). This is true independent whether you measure it by mass or by number of atoms and molecules.

Why is this important?
As I see it the ionosphere is the part of the atmosphere that connects the electrically neutral atmosphere at high pressures and the low-pressure ionized regions of the universe.
Thus, any planet will have firstly an ionisphere and secondly maybe an electrically neutral region that we call "atmosphere". There is a caveat here, as the ionosphere doesn't have to be fully ionized, just have enough electrons and ions floating around to act as a plasma.

Why is gas ionized at low pressures?
The amount of ions that fly around in a certain volume is not only a function of the amount of freed electrons, but also of the amount of electrons that recombine.
The strength of ionization will be a function of the process under consideration. However recombination will be independent of this and be governed by a $\sim n^2$-dependency on the density $n$.
This will generally result in a disproportionally weak recombination as pressure / density decreases high up in the atmosphere. Or in other terms: At low pressures, you can get ionized thermally, by UV-photons, [...] but you don't find a partner anymore to recombine.

Concluding
I've presented a case why every planet must have an ionosphere. Details like the solar wind, distance from the star, it's class and atmospheric variables then control the shape of the entailing magnetosphere and exact height-profiles of ionized species.