and the wisdom behind that, is that when a person is dying, he can possibly lose the ability to move his lips, so Allah made it easy for him/her to say Shahada before his death.
“So which of the favors of your Lord would you deny?” [Quran 55:13]
subhanAllah.