I'm wondering whether it was an established aim of Rome's decision-makers to expand their territory, in the mid-Republic especially at the time of the Punic Wars and action against Macedonia. Was there a desire to conquer all the Mediterranean or did the wars that led to new territory come about just from Rome defending itself from external threats and therefore pretty unavoidable?
It is neither. Roman expansion was driven by a complex set of interacting causes, which I'll elaborate on below. Firstly though, I'd like to take a moment why both options you mention are not quite right.
The idea that Roman expansion was "an established aim of Rome's decision-makers" reeks of some type of 'grand strategy'. There was none. Roman expansion was piecemeal and haphazard. Sometimes Rome would take land from a defeated enemy, sometimes they would leave the enemy as a puppet city/state, sometimes they would impose peace terms but otherwise leave the defeated enemy be, sometimes they would 'liberate' a state/city from another major Mediterranean power. There was no rhyme or reason to it. At first Rome didn't even have provinces, and once they did start creating province some areas would be incorporated as provinces relatively quickly whereas others would only become a province under the Principate.
Another important thing to remember with the idea of an "established aim of Rome's decision-makers" is that Rome's decision-makers were not a single group in unanimous agreement. In the period of the expansion in Italy, Spain, Greece and North-Africa the Senate still was the domininant political factor in the Roman Republic. But even the Senators had divided opinions on what actions should be taken. Matters were settled by debates and by votes. Every year decisions on leadership and strategy were taken anew, every year with renewed political gamesmanship by notable figures - this means that strategy might change from one year to the next.
With that out of the way, let's adress the idea that Rome's wars were defensive wars, protecting Rome or it's allies from warlike neighbours. This idea has proven to be false. To be fair, this idea was very popular a century ago and hasn't yet left the 'public conscience'. The notion of defensive imperialism got very popular during the second half of the 19th century, when Western empires were all the rage and when nascent countries like Germany and Italy were fighting to unify their countries. The ancient Roman wars of expansion mirrored the modern ones of Germany and Italy, and if the Roman wars were justified, so too were those of Germany and Italy. One the most well-known proponents of Roman defensive imperialism was the German historian Theodor Mommsen. He argued that Rome was fighting to maintain the status quo; that Rome wasn't driven by a desire to expand but that it was always a case of conquer or be conquered.
This idea of defensive imperialism remained popular among historians in the first half of the 20th century. Gradually things began to change though. German unification had turned out to be the bane of Europe and indeed the world, and the Western empires were falling apart. Defensive imperialism was no longer needed to justify modern examples - the contrary might even be true: defensive imperialism started to be seen as propaganda. Roman sources speaking of defensive wars were examined critically. In the 1970's historians started to deconstruct the notion of defensive imperialism thoroughly. Several articles appeared, but the most influential critique was a book published in 1979 by William Harris: War and Imperialism in Republican Rome 327-70 B.C..
Harris argued that the Romans had become habituated to continues warfare. Succesful wars brought glory and economic benefits, which why the Roman elite constantly looked for wars to fight. In his book Harris looked at the causes and justifications for all the wars Rome fought. He found that some wars were defensive, but that was just a minority. Other wars were provoked 'defensive' wars and many wars were blatantly aggressive. John Rich summarises Harris' argument thusly:
The core of his case is made in the first two chapters, where he gives a structural account of the role of war in Roman life, the attitudes both of the Roman élite and of ordinary citizens to war, and the economic benefits which the Romans derived from war. (...) Chapters 3 and 4 are devoted to Roman expansion: here he argues that expansion was a Roman aim, and that the Romans generally welcomed opportunities to annex territory except when special circumstances decided them against doing so. (p. 39-40; emphasis mine)
Wait a minute! Didn't I just say above that Rome didn't have have an established aim of expansion?! Harris obviously disagrees.
This is where further research in the 1980's comes in. Harris' book was welcomed by historians for its novel approach and its thoroughness, but it was also critiqued for being to single-minded. The idea of constant defensive wars was being replaced by the as single-minded idea of constant aggressive wars. In the ensueing debate some historians defended defensive imperialism, some historians defended Harris, and some historians came with newer still analyses. The most important of which was Arthur Eckstein's Senate and General: Individual Decision-making and Roman Foreign Relations 264-194 BC.
Note that both defensive imperialism and Harris' aggressive imperialism assume Rome to be single actor. Rome fought wars, Rome annexed areas, Rome made decisions. Granted Harris' found that societal and individual factors (economic benefits and glory) played a role, but he saw that as defining the Romans, who acted as a single group. Eckstein changed this, as should be clear from the title alone: it's about individual decision-making. Let me quote from a post I made some time ago:
Eckstein examined many of the wars in that period. He looked at the instruction generals (consuls or praetors) received from the Senate and what the generals actually did while in the field. He found that the generals had a large amount of freedom to do as they saw fit. Attacking cities, making peace treaties, provoking wars, it all happened. In theory all actions of the general had to be approved by the Senate at the end of the year, after the general returned to Rome, but Eckstein found that this was just rubber stamping. In all those years, it happened only once or twice that the Senate did not approve.
The freedom Roman generals enjoyed can hardly be overestimated. Roman consuls and preators were granted imperium, which historically was the power of the kings of Rome to act in the public interest. When the Romans deposed their last king, they didn't want a single person to wield all that power, so they divided imperium among two yearly elected consuls. Later praetors were added, who were granted a lesser form of imperium. The power of consuls was only limited by the veto of their collegue or of a tribune of the plebs. Once a consul was in the field with his army, he could wield his power nearly without restraint. Eckstein found they often used this power to the maximum extent. Some consuls even went looking for wars outside of the mandate they were given by the Senate at the start of the year. It is cases like that which show the idea of Roman expansion being a conscious, established aim of "Rome" to be false. Sometimes it was just individual generals being greedy for gold or glory.
With wars providing opportunity for gold and glory, individual senators had cause to procure positions in which they or someone they're close to would get these opportunities. Rival senators would have attempted to thwart that though so that their own candidate would be elected to such a position. Because the election of consuls and praetors happened seperately from the assignment of 'provinces', it could happen that someone would secure a consulship but that he would get assigned an area in which nothing was to be won. The practice of extending command of armies to ex-consuls for another year (prorogatio) made this trick especially popular.
A consul stationed in Greece might convince the Senate that it wouldn't be needed to send a new consul and that he could wrap things up the next year as proconsul. The new consul might then be assigned Italy as province (fighting poor Gauls) while the proconsul in Greece could continue fighting a profitable war in the east. In some cases a consul would go so far as to start peacetalks and have a peace treaty at the ready. New consul gets sent to Greece? Quickly put the peace treaty to the Senate and end the war. New consul gets sent somewhere else and old consul can stay in Greece? Cancel peacetalks and continue the war. This stuff (and stuff like it) actually happened. Aristocratic rivalry had a huge effect on Roman expansion.
Taking all of this together, what was behind Roman expansion? John Rich summarised it as "Fear, Greed, and Glory". Some wars of Rome were fought to defend against real or perceived threats. Many wars though were aggressive in nature, feeding the hunger for gold and glory in the Roman aristocracy and even the Roman citizens. (Legionaries too could get relatively rich from looting.) How, when and why certain areas were incorporated into the empire as a province (or not) is an entirely different beast but also is mostly influenced by economic considerations. If sufficient gold and grain can be extracted by demanding tribute, there's no need to incorporate the area. This is why Greece remained nominally free for two centuries after Rome first fought wars there, whereas Sicily and Sardinia were made a province almost immediately.
[Sources listed in reply-comment due to character constraints.]