Only a person who grew up on a farm can answer your precise question. I have known people who had a farming background and they were great people. I have known others with similar backgrounds and they were not so great.
On a farm, growing up, I imagine that children have certain responsibilities, and the parents are usually available at home. You lean a degree of self-reliance, respect for the land and respect for the animals that you raise to supply food to this nation.
I think you can learn those same qualities in other settings. It is up to parents to see that those qualities are taught. Children can be given responsibilities. Familes can spend more time together, you can be taught to respect the environment and you can be taught to respect where the food you each day comes from and I do not mean the supermarket.
I think the character of a person is defined more by the lessons learned than by the actual environment. My grandparents had a farm. By the time I was old enough to know it was a farm, they were only growing a few vegetables for their own use and had a few chickens that would lay eggs almost anywhere. They once raised strawberries, but lost a year's crop during the depression, becuase the trains did not run for two weeks after the crop had been picked. They also had a few dairy cattle, but the local dairy also closed during the depression--I am talking about the great depression of 1929 not the depression or recession we are now facing.