Actually most licenses don't require you to give the source code to the
public. It can also be very beneficial for companies to use Free software.
Lets say I am running a supermarket or shop. And lets say I use open bravo
(POS cash register software that is GPL). So lets say your competitor also
uses the same software. However lets say the program lacks some feature you
wish to have (and would help you gain an advantage over your competitor).
You can put that into the program and have no obligation to share that
improvement with anyone. The only time you are required to share source code
is if you give someone a copy. So if you were to decide to give your
competitor a copy then yes you would be required to share that change.
Secondly, depending on the business Free Software might save you money. In
the same above scenario with the store if I was to use proprietary software
and I wanted some feature implemented I would have to go to a 3rd party and
beg and plead for them to add the feature/fix the bug. However with free
software you can fix it or have an employee fix it.