The reason why it's illegal to plant shelled corn is because most of the commercial corn is protected by intellectual property rights, like patents, which makes it illegal to save and then replant corn.
Also, shelled corn is also often treated using insecticides and it generally doesn't produce a quality crop of corn, as a result of the loss of hybrid vigor and genetic stability which occurs with each subsequent generation of corn.
Corn also can't grow in the wild because corn is a human made crop, which depends on human intervention for propagation.
Ancient people also selectively bred the wild grass, teosinte, over thousands of years to create the corn with larger and softer kernels and a structure in which the kernels cling tightly to the cob.
This means that the corn kernels have to be manually removed from the cob and then planted to grow, and without the human assistance, the corn would not survive or grow and produce.
Corn is man made and does not exist naturally.
Corn is a man made crop and was domesticated from the wild grass called teosinte through thousands of years of selective breeding by indigenous people in Mexico.
Today's corn does not exist wildly in the wild and corn relies on human cultivation to survive.
Teosinte which is a grass is the wild ancestor of corn.
Ancient farmers around 9,000 years ago began to cultivate the teosinte.
The teosinte ears were also small, with only a few kernels far apart, unlike the corn we know and eat today.
And over many generations, farmers also bred teosinte plants with desirable traits, like larger ears with more kernels.
The process of the artificial selection also transformed the corn plant into a more useful and productive food source.
And modern corn is also a product of the long process of domestication and is a crop which cannot survive on it's own in the wild.