Why is it a bad idea to program user permissions for the program itself?

Why is it a bad idea to put the user permissions check into a compiled program? (Suppose the program is read-only and in a secure environment.)

Can you somehow modify it to achieve a good safety practice?

To visualize what I mean, look at the following link from a CTF (it only takes 5s to get the idea).