Basically, it has to do with meeting EPA regulations and long term reliability.
The YZ engine is physically smaller, vibrates a bit more, has a much lighter crankshaft and flywheel for much quicker revs, and has a cylinder head that is capable of making more power, all at the expense of how long the engine parts will last, given equal usage.
A WR-250X, even after having the mods done that most end-up doing to them, still falls flat on it's face on the top-end compared to the YZ-250F.
A WR-250X (or WR-250R), when stock, feels like a slow-revving snail compared to the YZ-250F.
That's because it is, straight off the showroom floor.
It has to meet EPA regulations for exhause emissions, noise, and is loaded down with parts to meet DOT regulations, not to mention parts to help prevent ambulance-chaser-lawyer lawsuits (like the side stand switch).
Also, the Yamaha factory would have a hard time producing a 250cc rocketship that still could have a chance of going many, many miles before an engine service were needed.
The WR-250X is, after all is said and done, still classified as a street bike, and I think a lot of riders expect lots of miles out of their street bikes before an engine service is needed.
A YZ-250F is not compliant with such strict EPA regulations.
That's the way it has to be if it's going to be competetive with the Honda CR-F250Rs, Kawasaki KX-250Fs, and Suzuki RM-Z250s on the race track.
Would you want to buy a motocross bike that's a snail compared to the competition?
So, compared to a WR-250X, it's a lot lighter, a lot more powerful, revs much quicker, and is much louder.
This is before you get into the differences in the chassis between the two.
The trade-off is that, because it's built lighter yet more powerful and quicker revving and, comparatively, a bare-bones and having just what's needed engine, and, maybe most important of all, Yamaha Motor Co. knows the kind of usage they'll see, it will more than likely need to be disassembled for an overhaul before the WR-250R.
This is assumed, of course, the WR-250X is ridden as most riders ride their street bikes and dual-purpose bikes.
I believe that if you were to give the bike to an AMA rider and say, "Go have a ball with it.", I doubt you'd get tens of thousands of miles out of the engine before it needed a teardown, too.