Random team composition is what helps your professor let everyone shine as you complete the assignment. You are most likely to be placed in a group with people you have rarely interacted before, which is a great starting point for deep, meaningful conversation. On the other hand, if you were to choose your team, you would probably choose your friends.
This is breeding ground for bias and lack of originality. When placed in a random team, one is more likely to try on a new role, maybe even show leadership skills that have not been seen before.
Moreover, a randomly assigned team will closely resemble a real-world situation, preparing students for their future.