Islam stresses on cleanliness and using the miswak is important to keep the teeth clean and prevent plaque which is more likely to appear while a person fasts all day. Prophet Muhammad(saw) has been reported of using the miswak to clean his teeth while fasting:
Narated By Abu Huraira: The Prophet said, "If somebody eats or drinks forgetfully then he should complete his fast, for what he has eaten or drunk, has been given to him by Allah." Narrated 'Amir bin Rabi'a, "I saw the Prophet cleaning his teeth with Siwak while he was fasting so many times as I can't count."
And narrated Abu Huraira, "The Prophet said, 'But for my fear that it would be hard for my followers, I would have ordered them to clean their teeth with Siwak on every performance of ablution." The same is narrated by Jabir and Zaid bin Khalid from the Prophet who did not differentiate between a fasting and a nonfasting person in this respect (using Siwak).
'Aisha said, "The Prophet said, "It (i.e. Siwak) is a purification for the mouth and it is a way of seeking Allah's pleasures." Ata' and Qatada said, "There is no harm in swallowing the resultant saliva." - [Bukhari, Vol 3, Book 31, #154]
It is better, however, to spit the resultant saliva because if one would accidentally swallow a piece of wood then his fast will get invalidated.
- Ebrahim Saifuddin