The basilisk’s corpse was never actually seen in the books.
When Ron and Hermione bring Harry the basilisk fangs in the book, the dead body of the basilisk isn’t seen or described in detail. It’s unclear in the book what state of decay the basilisk was in, it’s just said that Ron and Hermione took the fangs from it.
“Harry’s eyes dropped to the objects clutched in Ron and Hermione’s arms: great, curved fangs torn, he now realised, from the skull of a dead Basilisk.”
- Harry Potter and the Deathly Hallows, Chapter 31 (The Battle of Hogwarts)
They don’t describe the dead basilisk to Harry, and the reader isn’t “there” when they remove the fangs. In the book, there’s nothing indicating if the dead basilisk was a skeleton or a rotting corpse.
Little is stated about the decaying process of magical creatures.
Basilisks may not be equivalent to “normal” creatures - it’s nowhere near certain that any individual type of magical creature, unless it’s specifically mentioned, would decompose in the same way as “mundane” creatures. Magical creatures do many things mundane creatures cannot - as just one example, the Ashwinder, another type of magical serpent, is created by fire rather than being born in any typical manner, and collapses into dust when it dies.
The Ashwinder lives for only an hour and during that time seeks a dark and secluded spot in which to lay its eggs, after which it will collapse into dust.”
- Fantastic Beasts and Where to Find Them
We can’t reasonably presume that a basilisk would decay in the same way as any mundane creature. We also don’t know if the same sort of creatures that would consume mundane animal bodies would be even able to consume the body of a creature like the basilisk - this may be different as well.
Out-of-universe, it could have been done because it looked better on-screen.
To show the dead basilisk on-screen, the filmmakers may have considered it better to show a skeleton rather than a decaying body. This could be for many reasons, for example to create visual impact, or possibly because they considered showing a decaying body to be needlessly gross.