Why is exp used in encoder of VAE instead of using the value of standard deviation alone?
In the source code, the author defines sd by

sd       = 0.5 * tf.layers.dense(x, units=n_latent)    


which means that $\operatorname{sd}\in \mathbb{R}^n$.
In particular, the support over sd includes negative numbers, which is something we want to avoid.
Since standard deviations are always nonnegative, we can exponentiate to get us in the correct domain.
This is a case where the variable is inappropriately named.
Here, sd is not the standard deviation itself but rather the logarithm of the standard deviation. This allows it to be predicted as the output of a layer in a neural network, so extracting the predicted value of the standard deviation would require exponentiation.