Materials were intuitively uniform for 60,000 years. A few people started guessing they might be "atomic" about 3000 years ago. They only became rigorously atomic about two hundred years ago. And they only got a rigorous continuum model about one hundred years ago. But they were being treated as such on an ad hoc basis long before then.
There isn't any conflict between the continuum model and the atomic viewpoint. There never was. The two developed in concert.
Boyle published his 1662 law that involved gas pressure, and they needed a way to measure and mathematically handle this rather poorly understood phenomena. The "elasticity" of a gas was a real dilemma. Boyle and Hooke imagined little springs between their imagined atoms.
So in the 17th C, you had a hypothesized atomic model whose behavior needed to agree with the measurements of the day, quantities we now associate with the continuum model.
Enter calculus, stage right, which was developed from little "infinitesimals" (generalized atoms.) The result was integral and differential calculus applied to continuous functions (in retrospect, this was an unfortunate choice of terms.) In order to harness the power of calculus, it helps to have a formal underpinning that allows you to treat pressure, density, velocity, and a host of other things you can measure as continuous functions. They didn't have that in the 18th C, but that didn't stop Bernoulli and Euler from applying calculus to fluids. Work, as defined by Coriolis (1826), didn't need calculus, just buckets of water and a rope. But there's only so much you can do with those, and not everyone has a mine shaft. A calculus-based definition of work was a lot more convenient.
So basically, calculus was a solution in search of a problem. Fluid dynamics was a reasonable candidate. After a century of ad hoc application and some decent successes, mathematicians and physicists went back and developed the formal underpinnings to justify what had been done. It let us consolidate thousands of ad hoc experiments into a few laws, and it allowed us to do performance-based design of dynamic systems like steam engines.
Burying the lead - You said "We know that a fluid in reality is not continuous. It has spaces and voids between atoms and molecules."
You are assuming the continuum model assumes a continuous structure. It doesn't. What the continuum model does is assume continuous function expressions that relate pressure, density, etc to each other. Continuous functions are actually defined based on the epislon-delta argument of Cauchy.
In his 1821 book Cours d'analyse, Cauchy discussed variable
quantities, infinitesimals and limits, and defined continuity of
$y=f(x)$ by saying that an infinitesimal change in
x necessarily produces an infinitesimal change in y, while (Grabiner
1983) claims that he used a rigorous epsilon-delta definition in
proofs.[2]
Continuum models are, and always have been, fully consistent with an atomic structure. They were produced with that structure in mind. It is the behavior of the atoms that has been captured in the continuum model.