Farming lost it's prestige in prehistory with the growth of organized warfare.
Organized farming began many thousand years before Christ in the fertile soils at the estuaries of mountain run offs and in the flood plain of rivers. Most such communities were initially organized into small scale villages with communal farming and later developed into city states. Now here I am talking thousands of years before the Egyptian Pharaohs.
Organized farming led to a population boom at the time and as a result cities grew massively, spawning off sister villages which in turn became cities. Excavated statues and figurines show that up to this time such people worshiped the goddess and were probably organized on a matriarchal basis, with women or communities having title to the land, with women actively engaged in farming and advancing the science of farming.
But with population growth came conflict and warfare which eventual led to the creation of minor kingdoms, with rulers controlling several cities and communities, together with their farms. At this point the ruling class consisted of warriors and priests who would own the land but never work it. The work that was considered important was the work of the warrior and the intellectual work of the priests. Together with this upheaval feminine deities were replaced by male deities and matriarchal societies replaced by patriarchal societies, with almost all positions of power were increasingly dominated by men. This then, the fall of matriarchy and women's status coincided with the fall of the value of farming.
This tradition then intensified and grew until the first empires were formed, and it was fully incorporated into all the major succeeding empires, including the Qin, Sassanian, and Roman empires. By this point, all manual labor, with farming its chief employer was considered beneath the ruling aristocracy. Consider also that much farming was carried out by slaves and serfs who were tied to the land and were considered property. The sons of aristocracy would then either become land-owning warriors or priests.
Later, when Europe began its universities around 1100 AD, most universities would only study arts, medicine, law, and theology, with arts being the lowest in rank, and even then mainly consisting of literature and philosophy. So enshrined in the university system was the thinking that any kind of manual labor was unworthy of a scholar. I believe this kind of thinking still persists to modern times, though much eroded, so for example, law is considered higher than engineering.
So despite the fact that agriculture continued to be the main source of wealth for almost all ruling classes well past the Renaissance, agricultural workers were looked down on, with many aristocrats holding to the view that manual laborers were lower humans, less capable of thought and emotion, and generally of lower inherent value.