The main function of the middle lamella is to keep the adjacent cells together. The middle lamella is made up of pectin which acts as a gelling agent or glue that hold the plant together. In simple terms, the function of the middle lamella is adhesion of adjacent cells.
Image Source: http://www.mhhe.com/biosci/pae/botany/histology/images/cellwall.gif