I've researched this numerous times, Miracast was built as a universal standard, its what most casting is based off of, but Google stripped it from Android with 6.0.
Some Android OEMs like Samsung still support it, while those that stick with stock or near stock don't implement it. Personally I think Google did it to push their inferior Chromecast on the market, and its one reason I refuse to own a phone with stock Android.