I don't necessarily disagree with your assessment of the Intel Core i5-8400 as a good value. But then I consider that by the time you need to get a more powerful CPU to keep up with mid-tier gaming performance, you'll either have to get a 8700K or a newer "good value" CPU. The newer "value" CPU will invariable fail to work on your Z370 motherboard, so you'll have to buy a new motherboard and probably RAM in order to use it.
I don't have much of a problem with the fact that Intel keeps doing this. Because 99% of all computer end-users upgrade the platform as a whole. It's been five years for me, so of course I'm going to upgrade my CPU, Mobo, and RAM at the same time. But when I do, I'll be getting a much more powerful CPU than the 8400 to future-proof it and save money in the long run.