Wouldn't it be the major third as well?
The number of an interval is always determined by how many letter names (or staff positions if you think about written music) they encompass. C to F encompasses four letter names (C, D, E, and F) - therefore it has to be a fourth of some kind (note, it doesn't matter if one or both of the notes has a sharp or flat). After that we have to count semitones to determine the quality of an interval (i.e. if it's Perfect, Diminished etc.). For the number of semitones needed for each interval, you can look at this chart (ignore the bit about tuning systems)
You are of course right that the diminished fourth sounds the same as a major third. They are, as we say, enharmonic, but for theoretical reasons we distinguish between the two. This is similar to how we do with notes as well. C# and Db, sound the same but they get different names based on the context they appear in. Incidentally, the distance from a Db to F would actually be called a major third, since D to F encompasses three letter names (D, E and F).
If you spell it Db - F (or C# - E#) it's a major 3rd. Spell it C# - F then it's a diminished 4th.
Same sound. Very likely a different harmonic function. We hope the composer chose the spelling that best clarifies the harmony, not the one that looked 'easier'.
If you have no problem with being scene at the seen of an accident, or sending your mail a Valentine in the male, I'll allow you to spell a major triad as B#, Fb, G. Otherwise, don't!