Two reasons suggested:
Mutually assured destruction - Earth knew that the Trisolarans had those technologies, and sharing them was a term for not transmitting co-ordinates into the 'dark forest'. Of course, doing so would likely lead to the destruction of Earth too, but it's a high stakes negotiation.
It was the only chance to rescue the population on the fleet. Diverting course was virtually certain death:
Changing course in any direction is death. This will cause the fleet to fly by the Solar System and into the desolation of space. The fleet’s life-support system will not last long enough to return to Trisolaris or search for another viable star system.
However Luo Ji is confident that Trisolaran science will not advance enough to rescue them, and the contact doesn't disagree; it's suggested that if humans are allowed to progress, they might eventually be able to save the fleet.
“This is important to you as well. The technology of Trisolaris has developed at a constant speed, and two centuries later, you still haven’t sent a faster follow-up fleet. In order to rescue the diverted Trisolaran Fleet, you have to rely on the future of humanity.”