The equivalences you mention---C♯/D♭, D♯/E♭, etc.---aren't actually the same note. They're called enharmonically equivalent pairs, but only in Equal Temperament are they tuned to the same frequency. See this question for more information on why they're not the same note.
As for why we need flatted notes at all, let's look at the how major scales are put together. We need to agree on these things:
- Every major scale has seven notes. They all start on a root note and proceed to go up in the following pattern: Whole Step, Whole Step, Half Step, Whole Step, Whole Step, Whole Step, and then a final Half Step returns to the root note (an octave above where we started).
- A major scale names each of its seven notes using the letters A, B, C, D, E, F, and G exactly once. It's important not to use the same letter twice because otherwise notation would be really inconvenient. Imagine if your major scale had both an F and an F♯ in it. Then every time you wrote a note in the first space of the treble clef, you'd also have to explicitly tag it with an accidental, either natural or sharp. What a pain, both for the composer and the reader. Key signatures avoid this problem, but they only work if we agree on this no-using-the-same-letter-twice rule.
With these two principles in mind, let's build an F Major scale:
We start with F. A whole note up and we get to G. Another whole note, and we have A. Now the first half-step. What is this note? It can't be an A♯, because we've already used A. It can't be a B♮, because B is a whole step up from A. It has to be some kind of B, but a half-step lower than B♮. And so: B♭.
Now that we've invented B♭, let's create the B♭ Major scale: B♭, C, D,... uh-oh. Guess we need an E♭. And when we create the E♭ Major scale, we'll have to create an A♭, etc. etc.
Of course this same idea justifies the existence of sharped notes as well. Create the G Major scale, and when you get to the seventh note you find that you've used up all the letters except F, yet you need a note a whole step up from E (or, if you like, a half step down from G). And so you're forced to create F♯.
One could ask why it is that the interval from E to F need be a half step. If E to F were a whole step and F to G a half step, then we wouldn't need an F♯ to make the G Major scale. This is true, but it's also robbing Peter to pay Paul: then the D Major scale would still require a C♯, while the C Major scale would now require an F♭.