Hello there, if you really want to understand why the whole operating system (GNU/Linux)
is free along with other programs I advice you to read about The GNU project
. If you have
more time you can read here
As far as security is concerned, There is nothing called a 100% secure OS, be it from
MS or anyone else. However, Open systems "tend" to be more secure due to the fact
that more people can look and examine the source code.
Take a look for example at encryption algorithms. The most secure ones are the publicly
available algorithms which are continuously subject to peer review and security experts
from all over the world. Security by obscurity is no security.
As well, since the source is available anybody can submit patches for potential security
holes. This shortens the time needed to fix security-related software bugs.
Being open doesn't guarantee that your system is more secure. One of the versions of a
famous mail program (I think sendmail or mailman) had a security hole for over 5 years
until it was discovered, although the code was already available for anybody to examine
(but nobody did).
Bottom line, Making your source code available is a step towards improving its security but
doesn't say that it is more secure.