The mushrooms will try to spread and fill the level. To prevent them from growing, make matches right next to the mushrooms. The match will cause damage to the whole cluster, and a damaged cluster does not grow.
Removing all mushrooms is not necessary in order to get through the levels. However, you might want to keep the top of the level clear from the mushrooms, so that new matchable items would fall down to the level to fill any empty tiles.