Not perfect vaccine
The two available (us) vaccines are not perfectly effective (only approx 75%) and each can cause mild side effects, not to mention cost.
So if the risk of getting typhoid seems larger than the benefit of the vaccine, despite the cost and side effect, then it is recommended. See a travel medicine
expert to discuss what is best for you and your specific trip.