Cells need a selectively permeable barrier sometimes called a semi-permeable membrane because some items need to be allowed to come in while others need to be let out of the cell. Cells could not be non-permeable which would mean nothing in and nothing out because the cells need to get nutrients and water in and get wastes out. Cells could not be fully permeable because other substances that the cells do not need would come in.
Semi-permeable membranes allow the cell to keep a isotonic state. The amount of water is the same inside as outside the cell. When there is more water outside the cell water would come in to the cell and the cell could burst. If the amount of water is less outside the cell then water would rush out and the cell would shrink. This is especially important for cells that are in an environment that is not isotonic to them. They have to have ways to keep themselves with water by pumping water out or pumping solutes out.
Glucose needs to be able to get into the cells as well as oxygen and water. The cells need to be able to get rid of carbon dioxide and other wastes. This is why a semi-permeable membrane is important.
A cell needs a selectively permeable membrane in order to maintain a balance of water in the cell and the ability to bring in glucose and other items it needs for both DNA and RNA processing along with waste removal.
At the same time, materials that may be harmful to the cell must be kept out of the cell, and its ability to differentiate between those that are necessary and those that are not needed keeps the cell healthy.
One of the ways we kill bacteria is through the understanding of the permeability of the membrane. Using salt water and gargling when you have a sore throat causes the water in a bacteria cell to leave the cell, thus lowering the concentration of salt in the surrounding solution, which makes it isotonic with the cell. In doing so, the water in the cell leaves the cell, and the cell dies as it cannot carry on its normal activities.
A cell can also be destroyed by having its surroundings too low in salt. Then the cell will take in more water to reduce the salt content. In doing this, it enlarges and can burst.
As you can see, the ability to control the amount and kind of substances through the cell membrane is very important.