In short there is no apriori reason per se why GDP should always contain unit root, although many macroeconomists would argue it does. First, you have to make a distinction between real and nominal GDP, I will focus more on the former as common in economics.
As you correctly pointed out in a unit root series "the shocks to the series never die out". So the question whether GDP should or should not have unit root boils down to whether you can say that GDP is path dependent or not.
Traditionally in past the prevailing view in macroeconomcis was that when it comes to GDP all shocks are transitory (as you mention being taught at school), because as argued recession should not change the path of GDP. However, arguments can be made that real GDP should be path dependent. For example, recent Great Recession is often considered as an evidence for GDP being path dependent. According to Davidson, Meenagh, Minford & Wickens (2010)
The recent Great Recession is an example of
the latter that is fresh in all our minds: in it the OECD economies suffered a severe drop in activity that was impossible to forecast and may also not be reversed, in the sense that output seems set to resume its previous growth rate but not recover to its previous trend level. This description has the hallmarks of
non-stationarity where random changes in GDP growth lead to permanent changes in the level of GDP.
Indeed if you just casually examine the US real GDP series it seems that Great Recession lead to permanent change in the GDP level as you can see on the picture below I took from CBO:
If GDP would be stationary you would expect that even after sudden shock it would eventually revert to its mean along the growing trend, but the crisis seem to have a permanent effect on GDP and this is consistent with assuming that GDP is non-stationary. However, this being said just the picture above is not an evidence enough to decisively say GDP contains unit root as it could be an example of just on-off structural break (also @Michael has nice explanation on how the views on this depend on RBC or New Keynesian point of view).
To argue that unit roots are present in GDP some serious econometric analysis is required. And actually the whole debate on whether macroeconomic aggregates have or not have unit root started with an econometric analysis of the Nelson and Plosser. In their paper they showed that actually empirically most macroeconomic aggregates including both real and nominal GNP (which are closely related to GDP - they track national product instead of domestic product) contain unit roots. This sparked a lot of follow up research on this topic.
Many papers since provide also evidence for unit roots but there are also some notable exceptions. For example, Fleissig and Strauss provide evidence that in a panel of OECD countries the GDP seems to be stationary. However, it is also worth while noting that such results do not imply that all series in the panel are stationary. Generally, I would say evidence when it comes to the GDP points towards unit roots. However, unit root testing in general has a lot of methodological issues - for example it might be incredibly difficult to distinguish between near unit root process where series is still stationary but has high autocorrelation, from genuine stationarity. Due to that this question will probably remain unsettled for some time.