He said Indonesia respected human rights but there would be "no compromise" when it came to punishing such sexual crimes.
Indonesia passed controversial laws earlier this month authorising chemical castration for paedophiles.
The laws were however subject to fierce debate in parliament.
The Indonesian Doctors Association says its members should not be involved as the procedure would violate medical ethics.
Chemical castration is the use of drugs to reduce sex drive and libido, without sterilisation or removing organs.
President Widodo said "our constitution respects human rights, but when it comes to sexual crimes there is no compromise".
"We are strong and we will be very firm. We will hand out the maximum penalty for sexual crimes."
He added: "In my opinion… chemical castration, if we enforce it consistently, will reduce sex crimes and wipe them out over time."