I think Moto/Lenovo disabled it to force the use of projector snap or chromecast.
You'll need root enabled.
All you have to do is change one line on your build.prop.
You have to change the line
If you're Lineage based rom, you will have to add the line.
Now you reboot and Miracast can be enabled.
If this tutorial helps you, hit "thanks" button.