The purpose of the team's code is to make it easier for you to invite other users to join your team. Even though you can search by name, the results listed can sometimes be confusing and it may cause you to join the wrong team.
By sharing the code, the user that receives it will only have to enter it in the search bar for the team they wish to join to appear.