I was using the file from my pendrive (FAT32), that could be the problem maybe.
Almost definitely. We have questions on executing on FAT-based filesystems dating right back to the start of Ask Ubuntu.
Simply put, that's probably your problem if you're using the default mount options and the best fix is to switch to a better filesystem. Ext4, even NTFS... Just something mildly POSIX compliant that supports execute bits. Or you can hack around it and manually mount all the files as 755 (eugh).
You can sidestep the permissions framework by executing the file with the ld linker system. It's a bit messy but it should work for a binary file (probably won't work on scripts):
/lib64/ld-linux-x86-64.so.2 /path/to/64bit-binary
/lib/ld-linux.so.2 /path/to/32bit-binary
If it's a script you can also load a file through its interpreter's binary (rather than relying on a shebang):
sh /path/to/script.sh
python /path/to/script.py
ld
workaround is just a cool/scary workaround—. Fix the problem by using a proper filesystem. Copy the file off to a filesystem that supports execution. – Oli Feb 06 '15 at 13:11