Since at least the 16th century, English speakers have been referring to periods of youthful hijinks as “sowing wild oats,” with variants like “so and so was sowing his oats.” This colorful phrase has appeared in some form of another since the time of the Greeks, and several cultures have their own versions of this concept, all of which reference irritating weeds which can wreak havoc on agricultural crops.
Wild oats are the untamed predecessor of oats, a valuable cereal crop which is grown in many regions of the world. Wild oats, however, do not produce useful heads of grain, and they are also very adept at infiltrating fields of crops. The only way to get rid of wild oats is to repeatedly hand weed a field, and in some cases a field may be plowed and reworked to get rid of the invaders.
Therefore, wild oats are associated with damage and wasted time. Someone who is sowing wild oats is engaging in frivolous and potentially damaging pursuits. In many case, the term is used specifically to describe a harmful occupation which could damage the reputation of a family, or pose a threat to someone's future. While sowing wild oats, someone is not taking steps to advance a career or do something useful with life.
This term also has another, more crude meaning. Most people only talk about sowing wild oats when it comes to young men, with the lewd implication that young men engage in a variety of sexual adventures while sowing wild oats. These adventures could be harmless learning experiences, but they could also result in more serious problems, like unexpected pregnancies or diseases.
Youthful dissipation is a time-honored occupation, especially for young men. Many cultures assume that young men need to spend some time sowing their oats before settling down, and in some cultures the activity is actually actively encouraged, sometimes to the despair of young women. Historically, the concept has been applied in a very sexist ways, with young women remaining proper and modest, while young men are allowed to have adventures and see the world.
A few youthful adventures could probably be considered character building, and many youths of both genders get into a few scrapes today. However, a prolonged period of useless occupation tends to be frowned upon, as most societies would like all of their members to be productive, upstanding citizens.