As in agriculture, it is necessary for human survival, and besides that it also provides renewable resources.
-snip-
Or they will invest in the education of their people to improve their economy. Japan and Taiwan are great examples of these because both countries are neither great for agriculture or have oil wells they can drill, but most of the world's tech are dependent on these countries' innovation and inventions.
Many countries in the world that are enriched with oil and do make use of the oil as an efficacy to reduce stress and promote productivity of crop.Oil resources are used to power mechanical farm equipment to make the work easier and faster for man and are used to produce fertilizers for productive farm produce.
In a perfect world, you will choose both. Though in reality, you will choose only one of them and choose to import the other in order to sustain your economy and people. Oil countries in the Middle East aren't really self-sufficient when it comes to agriculture, and they import majority of their produce from other countries. They made sure to invest a lot of their money in drilling oil wells and refineries before they sell it to the world. They are one of the leading countries in terms of GDP but they lack fertile lands to support agriculture.
Countries who aren't blessed to have either of these two will have to find something that they can sell to the world in order to import their needs. It's easier to say that you will prioritize both even though you don't have the means to be self-sufficient at it, nor import it in the first place.