It's a combination of several different factors; personal, ideological, cultural, and strategic. I'll break each of these four down separately as best I can.
Personal: After he'd left his home in Ajaccio at nine years of age to study in French schools, he'd developed a love of history, especially ancient history. He compensated for not having many friends at school and often being a loner that was sometimes bullied by immersing himself in the accounts of the heroic and impressive deeds of great men of history, most notably Alexander, Hannibal, and Julius Caesar. He often fantasised about being a great commander like these men, and wanted to leave his mark in history. He hated the idea of just being a regular person with no authority or power or glory. He showed little interest in non-military historical figures, although this was partially the result of studying at several French military academies, so he tended to stick to what was relevant for what he wanted to achieve. There's an amusing and enlightening anecdote about one day in one of his classes the teacher divided everybody in the class between Romans and Carthaginians to play a mock battle, and Napoleon apparently cracked a tantrum and refused to play because he'd been assigned as a Carthaginian, and he didn't want to be on the side of the losers. His brother Joseph ended up swapping with him. Napoleon saw defeat as deeply shameful, and even took a Roman and Japanese attitude to it in that he attempted suicide after abdicating in 1814, and later tried to get shot at Waterloo when his army had been defeated. To him, it was victory or death. He had to keep pushing on wards to the extreme limits, because if he stopped or went back even a few steps, it was an admission of defeat and weakness. This is why he adamantly refused to give up even "one inch of French territory" in 1813-4 despite generous peace offers from his enemies. It simply wasn't in his psychology to be able to do so.
Ideological: Napoleon's political views are very interesting in that they changed quite dramatically over the course of the French Revolution. At the beginning he was a hardcore Jacobin, preaching for the overthrow of the king, the establishment of a republic and constitution (he was also a great admirer of George Washington), and also the propagation of republicanism throughout the rest of Europe. He had several associates high up in the Jacobin faction, most notably the Robespierres. However, while he eventually became less radical and more of what we might call a 'centrist' today, in that he was opposed to unbridled democracy and "mob rule" (similar in this sense to his American contemporary, Alexander Hamilton) and thought a strong central executive led by a single man was necessary to maintain order and establish a strong state. Naturally, because of his military education and personal interests in historical military strongmen, he thought this leader should be from the military. He loved the strict discipline and hierarchy of the army, something that put him at odds with many revolutionaries. That said, he still believed in many core values of the Revolution, such as equality before the law, the abolition of hereditary noble privileges (at first), the abolition of feudalism, the nationalistic concepts like a unified law code and language, etc. Some of these values would shift when he came to power and especially when he became emperor, but he still prided himself on being the more 'moderate' manifestation of the Revolution, and any land conquered by the French would have these values forced on them, whether they liked it or not. Napoleon saw himself not as a conqueror just for the sake of glory and power, but somewhat in the sense of how the Romans saw themselves as civilising the barbarian world by conquering them and incorporating their lands into their empire. The ultimate legacy of whether this had a net positive or negative effect on the lands he conquered is a controversial and hotly debated topic, and there are points on both sides. This wasn't the sole reason he conquered what he did, but it was an important secondary reason.
Cultural: While Napoleon was born on Corsica and until his late teenage years hated France with a burning passion for annexing his homeland (his parents had fought as freedom fighters before Napoleon was born), his time in France and specifically his military education there completely changed his opinions on France. He came to have a deep pride and admiration in the country, especially its past military greatness under King Louis XIV. He believed France was the natural hegemon of Europe, be it under a king or a republic. He was disappointed that France had somewhat receded from this position in recent decades after the glory days of the Sun King, and wanted it to return to its rightful place of both military and cultural dominance. When he became emperor, he repeatedly compared himself to Charlemagne (who he naturally saw as more of a French ruler than a German or Frankish one) and claimed he was reviving the legacy of him by reconquering the same lands he did and bringing them together into one empire. He was especially adamant in establishing some sort of 'unity' between France, Germany and Italy, which he saw as being intertwined in a historical sense due to Charlemagne. Indeed, if one compares a map of Napoleon's empire at its height in 1812 with Charlemagne's empire at its height in 814, there are striking similarities, even down to the ownership of Catalonia. Napoleon had an ambitious vision of a unified Western and Central Europe that would end the constant wars there and establish some sense of peace and cross-cultural harmony.
Strategic: This is arguably the most practical and self-evidence reason for why he did what he did. All of the conquests that France made in the Revolutionary and Napoleonic period was justified in Napoleon's eyes because he insisted that France needed to be large and strong and dominant in Western (and later Central) Europe to deter the country's many enemies from swooping down, surrounding them and destroying them, as they attempted to do many times. The Revolutionary governments before him managed to establish France's "natural borders" at the Rhine, the Alps and the Pyrenees, but Napoleon saw this as not enough, and felt that a dominant position in Italy and Germany was necessary. The resources - both manpower and wealth - from conquered lands was used directly to strengthen France's military and to sustain such large-scale campaigns all across the continent. As the coalitions kept fighting against France, Napoleon realised they had to be seriously weakened to stop this from happening continually, and so after his defeats of Prussia in 1806-7 and Austria in 1809 he stripped them of a sizable part of their territory, Prussia losing as much as a third of its entire territory. This was sound from a military and strategic point of view, but had disastrous effects from a diplomatic and political point of view, since it only deepened the hatred of Napoleon and hardened their resolve to defeat him and restore their lost lands. At the peace talks at Tilsit in 1807, Napoleon told Emperor Alexander II of Russia that he saw the rightful balance of powers in Europe as being on a two-pole basis: France in the west and centre, and Russia in the east and north. As such, he sought not to dominate Russia like he did with Prussia and Austria, but instead to have them as an ally and essentially an accomplice in the subjugation of Europe. Napoleon always respected the power of Russia, and valued an alliance with them very highly. He thought that any domination of Europe was impossible without Russian assistance.
I hope this answer has given you some general idea about the various factors in play which determined Napoleon's course of action and some of his motivations. It wasn't a totally comprehensive answer, but I tried to keep it as concise as possible while also giving a decent explanation for each.