In Spanish it's, "Le agarraron con las manos en la masa." In English the translation is, "He was caught with his hands on the dough (or on his penis)." The reason why it's funny (in Spanish at least) is because masa is also slang for the penis so the saying has a double meaning. It's one of those things that are lost in translation.