I know that, especially in the later parts of World War II, the German army would often use StuGs when panzers were in short supply, but were they always intended to be used in this manner?
No. Conceptually, the StuG was closer to an infantry tank than a turretless tank destroyer, when first designed.
Its role was to provide direct fire support to attacking infantry. Hence it was equipped with a low velocity, short barrelled, 75mm gun which could fire a decent high explosive shell, but was less effective than smaller calibre, but higher velocity guns in the anti-armour role.
They were actually crewed by the artillery, rather than the panzer corps, underlining their role as a fire-support weapons system.
StuG's got up-gunned with longer, higher-velocity guns as the need for tank destroyers became apparent in the east, and the makeshift solutions of the Panzerjager 1 and Marder series were discovered to have shortcomings, notably the lack of overhead protection.
In this role, the StuG was highly effective. Roughly a half to two thirds of all tank losses in the western European theatre were caused by gun fire. And of that roughly half (a quarter of all allied tank losses) was due to to StuG's and other SPG's.
This may explain the form of mania the Germans had for turretless tank destroyers later in the war, where they made a TD version of everything regardless if they were likely to be effective or not, or whether it was economically advisable to do so.
Well, originally, Sturmgeschütz model tanks were designed as support vehicles for advancing infantry. During WWI, Advancing infantry would be forced to dig in and wait for supporting artillery to move into position in order to engage a fortified enemy. The Assault gun was the answer to this slow-down of the front line. Von Manstein is the original inventor of this idea, in 1935 he gave Diamler-Benz an order for what he called "Storm Artillery". DB used the chassis of the recently designed Panzer III, and that's the origin of the StuG III. As the origin of the StuG series lies in destroying fortifications and other light-skinned targets, StuGs were not originally armed with long-barreled or High Velocity shells. As Operation Barbarossa (The German invasion of Russia) began, Advancing infantry found the need for an offensive Anti-tank weapon. The Germans had a number of very well made and wheeled Anti-Tank guns (like the Panzerabwehrkanone 40), but Assault guns serve a more offensive role (Hence the name Assault gun). Anti-Tank gun crews are venerable to infantry fire. Simply put, the StuG series gave advancing infantry the ability to engage with armor, or entrenched enemies without their heavy arms being taken out by a well trained rifleman or flanking maneuvers. After 1942 most German Assault guns were armed with better, high-velocity guns and given the role of supporting infantry in fighting both entrenched enemies and enemy armor.
But there are many other factors that popularized the StuG III and other assault guns. Firstly, they were cheaper to create than their turreted brothers. The StuG III Auf. G was about 21,000 RM cheaper to produce than the Panzer III Auf. M. Secondly, removing the Turret and other parts from the Tank allowed for larger caliber guns to be mounted on the chassis, which was needed as enemy targets became better armored. Thirdly, StuGs weren't very tall so they presented less of a target at range. Here's a picture of someone standing next to one and for comparison here's a picture of someone standing next to a Panzer III, the tank the StuG III is based off
So in general, No, StuGs were not designed to be Tank destroyers originally, but they were found to be effective at that role, and so were used as such.
For answers about their use, I recommend using my sources: The Battle of the Tanks and Encyclopedia of German Tanks
If you have any immediate questions, feel free to ask.