The Sefer Torah was kept in the box received from the plishtim
How could they accept the gift from them didn't we learn on daf 10b bottom that the rabonim didn't want to accept charity from gentiles?
Sholom Rav,
What the P'lishtim sent was a gift in honor of Hash-m, from which no Jew benefited. It was therefore acceptable, no less than a burned-offering that they sent to the Beis-ha'Mikdash, that was duly brought on the Mizbe'ach.
Be'Virchas Kol Tuv,
Eliezer Chrysler