Hacking is lots of fun and a great public service as well.
As for securing a system against remote exploits, it's actually pretty easy – it requires a little effort on the programmer's part and a little effort on the user's part. The problem is that both the users and the programmers are completely lazy, incompetent and ignorant.
Many programmers rarely go researching best programming practices. If they ever hear about them, they tend to ignore them as something that's not relevant to them, or try to apply them only when they think they “matter”. After all, it's paranoid to sanitize your program's inputs if it's a simple program doing a simple thing or if they don't think they are somewhat important. They just to try to build a program that works, oops, I mean, appears to work. They are more commonly known as PHP “programmers”. But it's all a symptom of a greater problem, namely the “Why do I need this? How the hell will it be relevant to me getting a job?” any time people are confronted with any extraneous knowledge they don't think matters.
There's also the thing that businesses care more about their profit than a little bit of negative publicity, which is why some popular systems have been terribly insecure until it started hurting them cause people were heading for the competition.
Computer administration tends to suffer from similar problems – admins try to get the systems up and running, but forget to update their systems, and don't bother to add additional obstacles to anyone compromising the system. Or even worse, assume that these additional obstacles are enough to protect themselves, so they skip everything else. They also try to write programs sometimes.
Security practices are also an
inconvenience for users. They tend to ignore them, or complain about them when they can.
Oh, and people who dare to report a security problems get called “hackers” and get arrested. So as a result certain security issues are only known by the bad guys.
---
An example on how easy it is to create and encourage security holes:
The C programming language has a function called
gets. It only exists so that programs using it don't break. From its documentation:
BUGS
Never use gets(). [...] It has been used to break computer security. Use fgets() instead.
Nevertheless, our admin used
gets in all his programs. Great idea.
Also note that if someone removed this function, it will cause programs to stop working, and people will stop using the operating system that removed the function, instead of stopping to use the broken programs.
P.S. I had a doctor prescribe me homoeopathic preparations once. That's the main reason why computer security is so easily broken. I then bought the homoeopathic preparations and used them
without questioning the doctor. That's the second reason.