Speaking pig latin, is not speaking another dialect or language, it is simply speaking in code. Thus, it is done so others cannot understand you, unless they are in the "inside" and you want them to understand. It is mainly an English phenomenon that African Americans employed to manage effective communication in the face of constant scrutiny of dominant white oppressors in earlier times of American history.
For example, Geneva Smitherman (a Linguist at Michigan State University), notes the still occurring use of "ofay" by Black Americans in her book "Black Talk." In normal english, the word is "foe." Indeed, African Americans still use this word and it is clear, then, to understand why "ofay" may have been effective for oppressed citizens under white domination in America. While "foe" may have caused further scrutiny, "ofay" would be more or less unheard, or dismissed, by white overseers.