Our free will came from God, if that answers your question.
Religion I think is our behavior associated with our attempts either to practice our faith or to appear as though we are practicing what we claim to be our faith.
If there is a purpose for religion, it’s created by humans. Jesus teaches us to abandon religion so that we can follow him.
Don’t miss this part:
Jesus teaches us to abandon religion so that we can follow him.