Imam Ali (AS) was with Prophet Muhammad (SAWA) in one side, while a group of opponents of Imam Ali (AS) led by Omar ibn Al-Khattab were on opposite side. They knew what the Prophet wants to write in favor of Ali (AS), that is why the rejected to allow him to write and went to the extreme of accusing the Prophet to speak nonsense يهجر.
They were ready to deny the whole Prophet hood if Imam Ali had written the Prophetic will in his favor.
Imam Ali (AS) same as the Prophet did not want them to openly deny the whole message of the Prophet (SAWA).
Wassalam.