Mushrooms will attempt to spread and fill the entire level. You can prevent them from growing by making matches next to them. The match will damage all the mushrooms, and those damaged do not grow.
Removing all mushrooms is not necessary to pass the levels. However, keep the top of the level clear of mushrooms so that new matchable items can fall to fill any empty tiles.