Why divide the t-test p-value by 2 in the SPSS output? In SPSS, the output of a t-test is always  for a 2-sided hypothesis. I know that if we are checking a 1-sided hypothesis, We need to divide the p value in the output by 2. However, it is not clear the theoretical/statistical reason for this. Can someone explain?
 A: You cannot just divide the p-value from a 2-sided hypothesis by 2 to get a p-value from a 1-sided hypothesis. You must first check which side of the t distribution your test statistic falls on and whether that is consistent with or not consistent with your null hypothesis.
A t-test will use a test statistic (we’ll call it x). Under the null hypothesis, x will follow a t distribution with a probability mass centered around 0.
When you generate a 2-sided p-value for a t statistic x, you add the probability mass of the t distribution in the region that is greater than |x| (absolute value of x) and that is less than -|x|. Because the t distribution is symmetric around zero, this is equivalent to twice the mass greater than |x| or twice the mass less than -|x|.
When you conduct a 1-sided test, you only care about either a case when x > 0, or when x < 0, but not both. So, if your alternative hypotheses is that x > 0, and x is a positive number, you only care about the probability mass in the region of the t distribution greater than x. However, you do not double this as you did with the 2-sided test because you do not care about the mass less than -x. So, in this case, the p-value from your 1-sides test would be half the p-value from your 2-sided test.
If this doesn’t make sense, check out this blog post.
https://statisticsbyjim.com/hypothesis-testing/one-tailed-two-tailed-hypothesis-tests/
A: I will also focus on the $t$-test as it is in the question, as the answer is not true for every statistical test (like those who are unilateral only).
When you carry your hypothesis, you have to fix your Type I error rate (false positive) and the direction of your effect (bilateral or unilateral). Usually, the first is .05 and the latter is bilateral (as SPSS does). When the test is unilateral (one-sided), you take all the reject area and put it on either side, thus having, let say, $5\%$, on one side. When your hypothesis testing is bilateral (two-sided), you are basically dividing the surface on two sides, thus $.05/2$.
If you look at most statistical tables for critical $t$-values, you will find that you  can swap from unilateral to bilateral or vice versa by dividing or multipliying by $2$ accordingly.

For instance, a $z$-score on a normal distribution (I choose that for ease, but it is true for $t$-values) has $2.5\%$ probability of being in the range $1.96$ to $\infty$ (a one-sided test). It has $5\%$ probabilities to be over $\vert 1.96 \lvert$, that is, including $-\infty$ to $-1.96%$ and $1.96$ to $\infty$ (a bilateral test). Having a unilateral test seems then harder to reject the null hypothesis, halving the type I error rate to $2.5\%$ in the unilateral compared to the bilateral. So, to get the same type I error rate, you can double it. The trade off is that it is on a single side.
The figure below shows that the area in one-sided test is "larger", however the surface are equal, that is, $5\%$. In each panel, their is the exact same probability to reject the null hypothesis (if it is true).

You can more easily swap $p$-value from unilateral to bilateral. You divide the $p$-value by $2$ and you are done. As stated by @clementzach, swapping from bilateral  to unilateral is more tricky as the direction as to be considered (which is why SPSS report the bilateral $p$-values, as it does not care about direction). For instance, a $z = 1.96$ has a $p$-value of $.05$ in bilateral hypothesis, but has a $p$-value of $.025$ for the upper unilateral (from $1.96$ to $\infty$), but a $p$-value of $.975$ if you were looking in the other direction (lower unilateral). So for doubling to be correct, the effect has to be in the correct direction.
A: We see $p$ values for two-sided tests represented like $p_{1} = P(|T_{\nu}| > |t|)$, but also see them represented like $p_{2} = P(T_{\nu} > |t|)$.
$$P(|T_{\nu}| > |t|) = 2\times P(T_{\nu} > |t|)\text{, so }p_1 = 2p_2.$$
For a given type I error rate $\alpha$, the rejection decision is:
$$\text{Reject if }p_1 \le \alpha$$
which is mathematically equivalent to
$$\text{Reject if }p_2 \le \frac{\alpha}{2}$$.
"Mathematically equivalent" means rejection decisions are always identical:
$$\begin{align*}\text{Reject if }p_1 & \le \alpha\\\\
\text{Reject if }2p_2 & \le \alpha \text{ (substituting $2p_2$ for $p_1$)}\\\\
\text{Reject if }p_2 & \le \frac{\alpha}{2}\text{ (dividing both sides by 2)}\end{align*}$$
