I'm not certain of the grammatical rules that apply, but it seems like the construction is "for [subject]" or "to [action]". When the author discusses "loving you" or "walking", it is in the abstract, discussing the action itself and not taking the action.
Another way to look at it is to consider the implied question -
"Why did you go to the store?"
"To buy milk."
vs.
"What did you go to the store for?"
"Milk."
In the first example, the "Why" is not specific, and the speaker may not know if it was a purchase, delivery, return, or for employment. The reply explains the action and the subject of the action.
In the second example, the "What/for" implies a purchase was made - the speaker already knows they went to buy something, they just don't know what. The sentence is about a specific thing - the milk.
In the song lyrics, things get a little confusing. They are discussing a specific thing, like the milk, but the thing they are discussing is an action. The action isn't being taken, it's just being discussed as a thing that could or will happen.
"What are those boots made for?" [implied: riding, dancing, working?]
"Walking." [implied: away from you, all over you.]
This is almost a joke - boots can be made literally "for walking", but the author is using the boots to discuss her romantic relationship. Like many lyrics, the meaning is more important than the grammar.
"What were you made for?"
"Loving you."
In this case the author is using "loving you" as another abstract action. In this case the author is using "loving you" in a very physical sense, meaning that while they are not yet "loving you" they do consider doing so to be the sole purpose of their life. Again, it is an action being treated as an object.