I know that a very popular view of religious food prohibitions is that it had health-based motivations. My personal opinion about the origins of Kashrut is that they were developed as a social filter. Dining with other people is a very strong social force, and if you cannot intermingle with an outside group in this intimate way, it will go a long way toward preventing dispersion.
For the particular mandate about milk and meat, it comes from the single sentence usually translated “You shall not seethe a kid in his mother's milk.” I have heard it argued that this came as a direct response to a ritual practice that was found in a competing religious group at the time of writing. If this is true, then the purpose was very likely, again, to prevent Jews from associating with or participating in competing religious events.
Having your day-to-day life require segregation from other groups, especially when they are performing their own rituals, is a very strong preservation mechanism for the group.