Let's consider an ideal gas in a box. I don't see why the number of microstates doesn't add up to infinity.
Let's start from scratch based on one of the simplest cases we can think of: a monatomic ideal gas.
We expect to get a multiplicity in function of its total energy $E$, volume in which the molecule moves $V$ and the number of particles $N$ (as in this examples $N = 1$, you do not have to worry about any extra factor related to $N$):
$$\Omega (E, V, N)$$
At this point, our objective is to get a formula for the multiplicity (i.e. the number of microstates associated to the macrostate of our molecule).
Let's first tackle the volume's role in our formula
Let's constrain the movement of our molecule by enclosing it in a container of a finite volume. Thus, there's a finite number of microstates associated to such a volume. A twofold increase in such a volume will lead you to twice as many states as before. Thus we expect the multiplicity of our molecule to be proportional to the volume (not I am not going to delve into details like what type of volume; just notice we're dealing with phase space, so we have the volume related to position and the volume related to momentum):
$$\Omega \propto V_xV_p$$
We're not done yet. We still have to tackle the energy factor
At first (if we are used to think in terms of classical physics) your intuition correctly tells you that the number of microstates adds up to infinity, as we don't think of energy as being quantized.
So you should change your approach and think of what Planck once said:
The energy could be a multiple of an elementary unit:
$$E = hf$$
Thus approach the problem of getting a (finite) multiplicity for the molecule based on quantum mechanics instead of classical mechanics (i.e energy thought as being quantized in discrete energy levels).
HINT: You may argue that we will get an infinite number of allowed wavefunctions, and thus an infinite multiplicity as well. Note that the wavefunctions that determine the number of microstates of our system are linear independent and finite, so this won't be the case.