I don't understand why this is "worse", i.e. why interviewing purely to get a raise should be thought of as a bad thing. To me, having many (hopefully low cost) interviews simply allows software developers to be efficiently priced as market conditions change.
Now, the natural response, if employee value can move upward more easily, is that employers will be less willing to offer job/salary security. But, on average, this is good, right? Fighting this is like fighting to go back to the old pensions system, which drastically reduced employment flexibility and was a major source of economic friction.