In some cases, usually on smaller frames, it is difficult to fit two bottle cages within said frame. How you solve the problem really depends on how close the fit is and the actual frame size.
For example, if it is a really close fit, then maybe just changing bottle cages is enough? i.e. with some bottle cage designs (see above) only the bottles themselves may touch slightly, which is not likely to be an issue.
Another solution would be to use a bottle cage relocator. These allow you to move the bottle cage up or down slightly. Of course, if you are moving the bottle cage up slightly, you also need to make sure you can still get the actual bottle in and out easily. So this may not be the solution for you if you have a particularly small frame. The following images depict a solution from Shimano, but there are a number of similar ideas out there.
It’s called the Shimano BA-01 bottle cage adapter, and it was originally designed to move the bottle cage upward on the seat tube should it obstruct the battery of a Di2 system.
Now if you really don’t have room for two bottles, there are some other solutions out there. For example, brackets that fit your handlebar/stem, or those that fit your seat/seat post. And of course, you can always use a hydration system such as those sold by the well known brand “Camelbak”.