Protecting identity of authorship of the code. People take great pride in their work and do not want someone else to come along and remove their name from it or claim that they wrote it. Distribution of source code. One of the problems with most commercial code is that you can't fix bugs or customize it since the source code is not available. Also, the company may decide to stop supporting the hardware you use.
Many free licenses force the distribution of the source code.
This protects the user by allowing them to customize the software for their needs. This also has other ramifications which will be discussed later. Many people write their own license. This is frowned upon as writing a license that does what you want involves subtle issues. Too often the wording used is either ambiguous or people create conditions that conflict with each other.