Was Enkidu created to be Gilgamesh's friend?
No. Enkidu was not created to be Gilgamesh's friend.
Gilgamesh was ruler of Uruk, but he was not ruling wisely. In fact, he was ruling quite badly. He was overworking the men, and he was ravishing the women. In fact, the epic specifically says no girl was left a virgin.
The people of Uruk couldn't stop Gilgamesh on their own, so they prayed to their gods for help. The goddess Aruru made Enkidu as someone to challenge Gilgamesh. He was made to be powerful enough to challenge Gilgamesh. He was strong, but wild, until he was tamed. Then the two men met, and immediately fought.
It was only after this powerful clash, in which they both earned the respect of the other man, that they became friends.
So, their friendship is a byproduct of how Enkidu was made and how Gilgamesh already was.