It is indeed true that the reason for an action precedes the action, while its purpose follows it, which implies that the two are altogether different. On the other hand, it is also true that, in everyday communication, a locution such as ‘the reason for this action is X’ is interchangeable with ‘the purpose of this action is X’. How can these two, seemingly contradictory, truths be reconciled?
The explanation is that, even though the reason itself precedes the action, the content of the reason (what the reason is about) usually involves something that follows the action. In other words, the reason for an action is usually that it is expected to accomplish some particular purpose. The two therefore tend to merge when they are spoken of casually, in spite of being, strictly speaking, quite distinct.
For example, suppose that I am going to the grocery store. The purpose of my doing so is having the ingredients necessary for the dinner tonight. That purpose will be achieved after the action of going to the store. What is the reason for the action? The reason is that I have formed the plan to eat at home tonight, together with my having opened my refrigerator and realized that it was empty. The planning for the dinner, and the discovery of the emptiness of the refrigerator took place before the action of going to the store. However, if I am asked for the reason, I am unlikely to say ‘The reason is that I made a plan to eat at home, and discovered that I didn’t have any groceries’; such an articulation of the reason, although accurate, would be overelaborate for the purposes of casual conversation. Instead I will say ‘to get something for dinner’. This brief formulation conveys the content of my reason in a way that is perfectly satisfactory for the purposes of casual conversation, but it obscures the fact that the reason itself has appeared in the past, even though it concerns something that will happen in the future. As the content of the reason is the purpose of the action, such an informal specification of the reason for an action is interchangeable with a specification of its purpose, even though the reason and the purpose are distinct.