JavaScript working when disabled (factory settings) in iOS is a bug?
"My question is, why was it turned off by default and still working?"

Obviously it was not turned off. The better question is: why was it displaying as disabled when it clearly was not? The only answer is that it is a mistake (regardless as to whether it was intended or not, which let's hope for everyone's sake it was not).

"Is this a bug or is there a reason for this?"

It's a bug whether there's a reason or not.

I've sent this information along as a 'Bug report' to Apple via both...
https://www.apple.com/feedback/iphone.html
...and also...
https://www.apple.com/feedback/safari.html

If this bothers you, I suggest you do the same.