"na" can mean "and" or "with". The word order in the sentence as well as the prefix of the verb indicate clearly towards "I eat with ...": ni-na-kula na mwalimu wangu = I-PresentTense-eat with teacher my
The other version would look like this: mimi na mwalimu wangu tu-na-kula = I and/with teacher my we-PresentTense-eat
I hope my explanation is helpful.
Could you not say "my teacher and i eat"? Where is the "with" in this?
'na' can mean either and or with. In this sentence "with" makes more sense. To translate "My teacher and I eat" would be something like (not a native speaker): Mwalimu wangu na mimi tunakula. In this case, even though the sentence looks quite similar, now 'na' means 'and'!