The purpose of the Farm is to create food to feed the residents of your village. The higher the level of the Farm, the more food your Farm creates and hence, the more residents you may have.
The Farm is also the place where you can enlist Militia, who will be temporarily relieved of their various jobs to protect your polis in times of need
More about Grepolis Farm on The Grepolis Website