The theory behind this goes beyond what is covered in AP Statistics, but a $(1-\alpha)\%$ confidence interval partitions the real line$^{\dagger}$ into a set of values that would be rejected by a hypothesis test at $\alpha$ (outside of the confidence interval) and that would not be rejected by a hypothesis test at $\alpha$.$^{\dagger\dagger}$ The confidence interval you calculated is based on the two-sample t-test, meaning that the inference from the confidence interval must agree with the result from the t-test. Good for you for thinking something was fishy when the methods disagreed!
It sounds like you did your hypothesis test with a one-sided alternative hypothesis but did a two-sided confidence interval. There is an inconsistency there. Do both the alternative hypothesis and confidence interval as one-sided or two-sided, but don't do one as one-sided and the other as two-sided.
You ask when to use a one-sided test versus a two-sided test. This comes down to your research question. If you only care about a change in one direction, a one-sided test is more powerful than a two-sided test. If you care about changes in general, either increases or decreases, then a two-sided test is appropriate. After you reject the null of equality, you can infer the direction of change by looking at the sign. However, it is poor practice to look at the sign and then pick the corresponding one-sided test in order to increase the power to reject the null hypothesis.
Once you know your research question and come up with your null and alternative hypotheses, then just be consistent when you calculate the p-value and the cofidence intervals.
$^{\dagger}$It can be done in more generality than the real line.
$^{\dagger\dagger}$ There are exotic confidence intervals where this is not true. See the comments that Alexis made to my response here.