Question: In this sentence: 做乜唔叫埋我? What is the function of 埋?

I understood this sentence to be: "why didn't you call me?" (perhaps to an outing or a party). What is the difference with the sentence "做乜唔叫我"?

Insights please.

Answer: 
做乜唔叫埋我? What is the function of 埋?

First the sentence reads as:-

做乜 = why, (for what reason)

唔叫 = didn't call, (didn't include)

埋我? = me as well?

The function of 埋 in this context of Cantonese speech is not "bury" but to mean "as well"

So, 埋我 means "me as well"

Of course in Cantonese 埋 also means "bury" in some other context.

Another example of 埋 is 請埋位食饭 = please take a seat for (food, dinner, etc), where 埋位 means "take a seat", and not "bury a seat" in this context.

From these basic examples, it could be seen that 埋 has multifarious usages in Cantonese speech, and only the context would ferret out the applicable meanings and usages.

Finally, Quote:- "What is the difference with the sentence "做乜唔叫我"?"

The "difference" between 做乜唔叫埋我? and 做乜唔叫我? is the "tone", meaning the intention behind the question.

In 做乜唔叫我?, it is more a straight forward, neutral inquiry.

In 做乜唔叫埋我?, the 埋我, "as well", has an "accusative" element, a certain covert unhappiness of "being left out" This accusative element could also be implied in the equivalent English sentences -- "Why didn't you call me"? and "Why didn't you call me as well"?

This accusative element is more pronounced if 唔叫 is translated as "not include" rather than "not call" because in Cantonese 叫 in certain context does not always mean "call", (as in call someone on the phone)
As verbal suffix, 埋 can function as a verb complement with a lexical meaning somewhat like "close, tight". In this case, it can be used together with an adverb of degree (such as 好，太) and 咗. For example:

1. 唔好企太埋。(Don't stand too close.)
2. 佢关埋咗度门。（He has closed the door (tightly).)

In a sentence like 做乜唔叫埋我?, 埋 functions as an aspect marker. In this case, it cannot be used together with an adverb of degree (such as 好，太) and 咗. And like many other aspect markers in Cantonese (e.g. 住，到，紧，亲...), 埋 "has lost" its lexical meaning through abstraction and become an aspect marker. The interpretation of the process where 埋 is used is a function of it's underlying value and the context.

As an aspect marker, 埋 is used in contexts where we have a class of possible values constructed as fragmentable or dissociable. For example:

3. 唔准玩，做埋啲功课先。(You are not allowed to play. Finish your homework first.)
4. 今日下午我地踢波，叫埋阿民啦。(We are playing soccer this afternoon. Let Ah Min join us.)

In (3), "homework" is constructed as a "fragmentable amount of work". You have already started, but there is still a fragment that remains to be done. In (4), there are a group of people who can play soccer together. 阿民 is singled out in the beginning as the one who may or may not play together.

In these examples, 埋 serves to cancel the fragmentation and return the class as a whole.