We are flattening the curve, yes, initially because hospitals don't have capacity, but the root of this issue is the exponential nature of infection transmission.
If we have the ability to build hospitals at a rate to match O(2^n) time then we can let everyone out and declare quarantine over! But as you know, an O(2^n) algorithm is extraordinarily hard to keep up with once n approaches any large number.
That's the curve we're trying to flatten - by changing the approach, changing the "algorithm" so to speak, by not allowing people to interact so they have less chance of infection.
If you are able to build a new hospital in a week, and then continue building a new hospital every day after that and then one every hour after that, and then a new hospital every few seconds after that, then you have a chance to keep up with an exponential curve (well, until the virus runs out of people to infect, so until it reaches 100% of the global population).