First let's note that the notion of perfect spatial flatness applied to our universe is a mathematical property which one would not expect the physical universe to show. However we can explore what sort of universe could have that property and still fit with general relativity.
Here are the possibilities:
The universe is finite and spacetime has a boundary of some sort in spatial directions as well as past temporal direction.
The universe is spatially finite and unbounded.
The universe is spatially infinite and always has been.
Note there is not a 4th option where the universe is spatially infinite now but was not in the past. You are right to suspect that would not be possible. However, there are some subtleties to do with the relativity of simultaneity, such that depending on how you define what events to call simultaneous, the same situation in spacetime can be described either as finite volume with regions of infinite density, or as infinite volume with finite density
(the Milne model illustrates this).
All such statements run up against the difficulty that we don't know what happened at early times when the universe was in the extreme conditions associated with curvature on the order of the Planck length.
Most physicists would guess that 1 is unlikely (it is sort of odd to think of a boundary where spacetime somehow stops). So we are left with 2 or 3. Both are problematic, and it is partly a matter of taste which one people feel more inclined to say is likely. I feel that to postulate an infinity of this type is too extreme a step, so I am inclined to go for 2. However, in order for a spatially flat universe to be unbounded it would have to have a non-trivial global topology, such as a 3-torus, and this is also a somewhat odd thing to propose. However, if I had to pick, then I would say this is a somewhat more palatable option than to conjecture that there is an infinite spatial region with an infinite number of galaxies etc. And it would be a conjecture. There is no way one could know that.
But fortunately I don't have to pick, because the idea of perfect spatial flatness is also somewhat unphysical, as I already said.
If there was some compelling theoretical argument to say that the average curvature $K$ of the universe must be exactly zero, then I would be willing to hear it. Physics at the moment does not suggest there is such an argument, so we fall back on empirical observations. Empirical work to date gives $K = 0 \pm \epsilon$ where $\epsilon$ is the experimental uncertainty. Thus the empirical work is consistent with both signs of curvature or none. We now bring in Occam's razor (the principle that one should avoid superfluous hypotheses) but this is somewhat subjective. It seems to me that to bring in the idea that there are an infinite number of galaxies is a superfluous hypothesis, when we have available the elegant and natural solution offered by the 3-sphere. In this I am influenced by the consideration that infinity is qualitatively different from any finite number. I think it is hard to support that notion that even $1000^{1000^{1000}}$ (or whatever) galaxies is but an infinitesimal fraction of the total, unless one has some argument to show why this is not a superfluous hypothesis compared to the simple 3-sphere.