I don't know if this was its first use, but in "The Once and Future King" by E.B. White (a book about King Arthur), Merlin transforms young Arthur into an ant. On entering the ant colony, Arthur reads a sign posted for all ants to read stating "Everything not forbidden is compulsory."
I've been trying to get this straight from memory. Google is no help. Everyone has a different version. Your version is the way I remember it, but it makes no sense. There is no way to forbid everything that needs to be forbidden. Perhaps that's the joke.