[update: A few hours later....
Others have mentioned if I delete this particular file under /data/misc/wifi, it will get regenerated. Well, it didn't on my phone. So I thought if I re-flash with a clean stock ROM, copy all files from this directory, then restore my Nandroid copy and then replace this directory with these clean files, it may fix the problem. After I re-flashed with a clean ROM, the WiFi still wouldn't turn on, but it did earlier! WTF!!!...
After checking under "About device", I noticed the baseband was from a different rev, I337MVLSGQB1, than the ROM I just re-flashed, I337MVLUGOH1. So Odin skip the baseband if the code on the device is newer? I then extracted the baseband, modem.bin, from the -OH1 ROM, and burned this file directly. Guess what? By having the baseband and the rest of the ROM both from the same rev, -OH1, my Wi-Fi is working again!
How do I explain the Wi-Fi was working too earlier? It's because I flashed the -QB1 ROM at that time. Thus, the baseband and the rest of the ROM was the same rev too at -QB1.
Now my baseband is back to the same rev as my Nandroid copy, -OH1. I restore my Nandroid copy and my Wi-Fi is working again!!! Huray!
I am not saying the baseband and the rest of the ROM always have to be from the same rev. Most custom ROM don't even come with the baseband. However, there is something funny about this I337MVLSGQB1 code. It is the same Android rev, 5.0.1, as the previous one, -OH1, issued 2 years earlier. Why did Samsung even bother? Well, they call it security fix. I don't know what exactly they fix, but I did observe a restriction. When I tried it last time, it prevented me from freezing bloatware using SD Maid. I couldn't tolerate it and went back to -OH1. I didn't know the baseband was still stuck at -QB1 and only the rest of the ROM went back to -OH1. Since I rarely use Wi-Fi, neither did I know this particular incompatibility also prevents the Wi-Fi from working!
In summary, make sure your baseband is not I337MVLSGQB1. If it is, then also make sure the rest of the ROM is also -QB1. If you don't like the "improvement" provided by -QB1, then downgrade from it, but make sure it is indeed downgraded. The -QB1 baseband may still be stuck in your device unless you specifically burn the modem.bin file from the rev you intend.
These are the stock ROM for the Canadian version of S4. If yours is AT&T, they will be different. However, if you come across a security fix issued in 2017 on Android 5.0.1, I am almost sure it will cause the same problem if you mix components of this rev with the previous one issued in 2015. The Canadian and AT&T versions of S4 are almost the same except the AT&T one has a locked bootloader, which prevents you from installing custom recovery and ROM. Avoid AT&T/Verizon phones at all cost if you are a hacker! My Canadian S4 is working great in the U.S. After all this AT&T protection (or limitation depends on how you see it) will not protect you when you mix two different versions of AT&T ROMs.