As usual in language evolution, having two auxiliaries wasn't a goal, things just happened this way (and in fact the long-term evolution is towards a single auxiliary).
There is an article in French Wikipedia that explains how the compound past tenses evolved in French (and to various extents in other Romance languages). My answer here is mostly a summary of this article.
In Latin (the ancestor language of French), past tenses do not use an auxiliary (except in the passive voice). All the past tenses are formed by adding suffixes.
The verb habeo (“have”) was not an auxiliary in classical Latin. However it it was sometimes used in combination with past participles. For example, “meam fidem est cognitam” (“my loyalty is known”) can also be said “meam fidem habent cognitam” (lit. “they know my loyalty”). This kind of phrasing was initially used with expressions meaning know, believe, etc. and was gradually generalized to more verbs.
The verb habeo was also used in constructs like “habeo literas scriptas” (lit. “I have a written letter”), which gradually came to be used to mean “I have written a letter”. The letter is a direct complement of the verb; this explains how habeo gradually became an auxiliary for transitive verbs. This meaning had become generalized in late Latin, while some of the single-word past tenses disappeared. This formation didn't make sense for intransitive verbs. Italian still uses the auxiliary avere for compound past tenses. In French, the auxiliary avoir became generalized not only to all transitive verbs but also for most intransitive verbs as well.
As some simple past tenses were disappearing, expressing a motion or state change came to use the auxiliary esse. For example, “venitus sum” literally means “I am in the state of having come” — that's essentially equivalent to veni (“I came”).
This formation converged with another reason to use the auxiliary be: Latin had deponent verbs, with only passive forms. In the passive mood, Latin did have some compound tenses, using the auxiliary esse. For example patior (“I suffer”), passus sum (“I have suffered”). The concept of deponent verbs disappeared as the endings got simplified and merged with active voice endings; this left verbs with compound tenses formed with the auxiliary be. In Italian, all intransitive verbs use the auxiliary essere for compound tenses. This was also the case in medieval French, but over time more and more verbs came to use avoir. In modern French, only about a dozen verbs (and their derivatives) still use être.
The evolution of French may have been influenced by German, which also uses either haben (“have”) or sein (“be”) to form compound past tenses, with haben being the most common and sein being used with verbs expressing a movement (ich bin gegangen: I have gone), a change of state (ich bin geschwollen: I have swelled), or sometimes a lasting state (ich bin gelieben: I have stayed). The French verbs that use avoir also fit in those categories, though in French many verbs that express movement or state use avoir.