In short, the Western scale is chosen to maximize the harmonic possibilities between different notes while having a reasonably even collection of whole-steps and half-steps between them. The black keys are the "in-between" half steps that do not appear in the C-major scale. The reason the ear likes harmony is probably due to our ears performing a Fourier transform on the incoming sound waves, and our brain blending together collections of multiples of some base frequency into one "note"--this lets us recognize the different characteristics of periodic oscillations from different physical sound sources.