This is a very common mistake that I always emphasize to my students not to commit. You're right: That interval (the same for both examples) SOUNDS as a minor third, but this isn't a minor third. This is an augmented second. When you spell intervals, you should think of the natural (not altered) notes as the first name of the interval and the alterations are the last name. The first name is what gives an interval the correct spelling: Moving from D to E is a second, same as moving from A to B, regardless of the alterations. You have a second here, not a third. Now the last name (the alterations) is what gives the interval its character (minor, major, augmented -this case-, diminished, perfect).

That's why spelling the scale as C-C# or G-G# is wrong. Normally, a scale is a succession of seconds. But C-C# isn't a (minor) second. Again, it SOUNDS like that, but scales shouldn't be spelled by the way the intervals sound. This leads to lots of mistakes. If you remove the alterations, you'll notice that moving from C to C is an unison, so C-C# is an augmented unison, which is supposedly a wrong spelling for a scale. C-Db sounds the same, but this is a real minor second (correct spelling).

Again, this is a very common mistake that I always try to clarify to anybody who "falls" in it. Hope this helps.