Why does the mass airflow sensor malfunction?

Two common reasons. The first is that it is like any other component and it can just fail for no reason. The most popular reason for malfunction though is people installing air filter incorrectly. This will cause dirt particulants to contaminte the little filament wires on the sensor. Once this happens it will never work correctly again. The best thing to do is to replace it. Even blowing the dirt and dust out will not correctly solve the problem. Good luck.