As I see it, the purpose of every metaphor is to get someone, perhaps just yourself, to look at something differently by comparing it to a similar object/process. The reason for doing this falls into two broad categories. It may have a didactic purpose, as when someone uses a metaphor to explain a foreign concept by appealing to a familiar one. For example, I often attempt to explain why proofs are important in mathematics by noting that the ability to perform a calculation is like being able to drive a car, but a mathematician is like a mechanic in that she or he should understand what is going on underneath the hood. The other reason is exploratory, the metaphor brings to light a new way of understanding the process in question, this is the reason that interests me most.
Metaphors are used in this sense by the artists. The poet who calls a sunrise a bird taking flight, or life a path through the woods, does not do so in order to explain the phenomenon at hand. Rather, he or she intends that we discover something new about the phenomenon by viewing it in a new light. This same notion can be used in an academic setting. Upon establishing a baseline metaphor between object of interest A and object of explanation B based on a given list of similarities, one can ask what properties of B that are not on the list have, in some sense, a corresponding property in A, in doing so, one often has new ideas about the nature of A. This is why I habitually try to extend most every metaphor to the point that it breaks down, just to see if anything interesting happens.
The last thing that I want to mention is that models, be they physical or theoretical, or both, are an important example of a metaphor. Whether you are trying to simulate something in a smaller, controlled environment or with mathematical principles, you are replacing the actual thing with a representation of it, which is a form of metaphor.