Yes, it serves as a lubricant to help you pass your bowel movements. However, heres an interesting fact. Did you know that you are not supposed to wash your rectum with soap and water?!! How crazy does that sound??!! My mother recently had surgery on external hemorrhoids, and a hemorrhoidal fissure inside her intestines. Her doctor said that washing the rectum with soap can cause the "gel like secretions" you referred to to dry up, and can cause all sorts of problems. Theres a little bottle of solution you buy at a drugstore that is like 17 dollars that you can use to wash with. Crazy huh.
My Doctor said there are some glands around the end of the rectum that secret this gel like substance to help move your stool along!
We'll I don't know ask your doctor but the gel is just discharge and the vagina's way of cleaning itself before your first period