Here we have a mean of (3), and a data point with a value of (2). If we didn't look at the absolute values, any dataset with both positive and negative data points would be messed up when we find the sum of each difference before dividing by (n) or (n-1) and then finding the square root.
When finding the standard deviation this doesn't matter, since we're only interested in the absolute value of the discrepancy between each point and the mean, as standard deviation is an absolute value. We want the absolute difference between the numbers but also the direction the point is from the mean.