First of all, note that "classical" string theory in 3 dimensions is no problem at all. The requirement for 26 dimensions only comes when you try to fit in quantum mechanics, i.e. you try to canonically quantize your strings. When you include fermionic strings as well, you "only" need 10 dimensions.
The mathematical reason, although the calculations are usually categorized in "advanced mathematics", can in principle be traced. (If it means anything to you: there is some algebra involving a central term which depends on the dimension d of space-time and only vanishes for a special choice of d = 10, 11 or 26 - depending on the theory you're looking at).
The physical reason why it should only work in that particular number of dimensions is, AFAIK, not so clear. At least I've never really heard any good reason why it is like it is, people just accept it and devise ways around it (e.g. compactifying the extra dimensions).