The purpose of the trip is not mentioned directly in the text of "Hills Like White Elephants." As in many of Hemingway's stories (e.g. "The Killers"), the reader is put in the position of an eavesdropper and has to make his or her own deductions. The main reason the American and the girl do not talk about the express purpose of the trip is that they have already discussed it at great length. Otherwise they would not be sitting there waiting for the train that will take them to Madrid.
There is another reason they do not talk about the purpose of their trip. What they are doing is strictly illegal. The girl is obviously going to get an abortion--but that word is never mentioned. Abortions were illegal in most places in the world in the 1920s, and they are in a foreign country where Catholicism is the established religion; they probably have no way of knowing how serious a crime they are planning to commit. It isn't something they want to discuss out in the open. They are in danger, and they won't be out of it for a long while. They are speaking in English, which is an advantage, but they don't know who else around them might understand English, and many people who didn't understand English might understand the terrible word "abortion." (The Spanish word is aborto. Very close!)
The girl doesn't want to talk about the purpose of their trip to Madrid. She doesn't even want to think about it. She tries to steer the conversation in any other direction, including to the hills that look to her like white elephants. But the American, who has obviouosly had a hard time talking her into the illegal and risky operation, doesn't want to let her get cold feet. He doesn't understand the emotions she is going through, but at least he understands that she is young and scared. That is the main reason she doesn't want to talk about it, or think about it, or hear about it.
"It's really an awfully simple operation, Jig," the man said. "It's not really an operation at all."
He gets no response from Jig. He probably should just shut up, but he can't. He is troubled by a whole spectrum of emotions. He feels guilty for pressuring this poor girl to do something he knows is against all her instincts. He is afraid she will back out. He doesn't know his way around Madrid, and yet he is going to have to make all sort of arrangements when they get there--including arrangements that are strictly illegal and could get him thrown in prison.
"I'll go with you and I'll stay with you all the time. They just let the air in and then it's all perfectly natural."
From these two quotations there should be no doubt that the purpose of their trip is to get Jig an abortion. There is a touching sentence which tells a lot about her feelings:
The girl looked at the bead curtain, put her hand out and took hold of two of the strings of beads.
She is thinking about the beads that come on so many of things parents buy for infants. There are beads on cribs, on play pens, on high chairs, on strollers, and on some wooden toys. Jig has probably wanted to have a baby ever since she was a little girl and first understood that she could have a baby herself some day. The reader's sympathies are entirely with the girl. The man is being a heel--and he knows it!
The purpose of the traveler's trip is not explicitly stated within the story. However, much of the dialogue between the man and the woman revolves around the abortion the man desires the woman should have. The only inference that can be made about the purpose of the trip is that the woman is going to Madrid in order to have an abortion.