In most cases the most expensive part of a digital camera is the sensor.
The simple explanation: The larger the sensor, the more expensive it is.
A more complicated explanation: Sensors are made using semiconductor technology, much like other electronic chips. In any semiconductor process you typically have an average number of flaws per surface area. A particular chip can have a certain number of flaws before it is considered useless. The larger of an area your chip comprises, the more flaws that it will have. Hence the larger the sensor, the smaller the yield per batch. It's not just a matter of how much space each chip uses, but also how many working chips you can get per wafer, so the price does not scale linearly with size. This is one of the reasons many medium format digital backs used more than one chip to make up their sensor unit, it's easier to get two working halves than one huge working sensor.
In any case, that's the technical aspect of things. Apart from that, there's the economics of scale, medium format cameras are simply far less popular. They also have other limitations like shutter speed, frame rate, and cross-sync speed due to their larger shutters.
As for why Canon or Nikon don't make MF cameras, only they know for sure. Most likely it's just not economically viable.