Why does frequency remain unchanged in light refraction but wavelength doesn't?

Here's a qualitative argument. A wave propagates in space and time, but the boundary is a barrier in space rather than a barrier in time. Hence the spatial part of the propagation will change, but the time part will not.

Think of people in a stadium doing "the wave." You know it's your turn to go because the person next to you went. There is a cause-and-effect relationship which exists at a certain moment in time, hence the time variation of the wave is always the same. The same thing happens with Newton's laws for a wave on a violin string: one element of mass makes a force on a neighboring element of mass.