Major and minor keys are two modes that became popular, and were cleaned up a bit. The key of C is Ionian mode. The other keys in the same mode (e.g. D) need to have sharps and flats to keep the spacings between the intervals correct for the same mode (e.g. in D, two sharps), which is why there are key signatures.
yours, Peter T.