The Spaniard, who successfully defended his European title in Manchester earlier this year, had been in good form all day and an early head kick, given on video review, saw him move 5-2 ahead after the first round.
Lee won Bantam Weight gold at the 2011 World Championships but showed his talent at this lower weight as he produced a shock result earlier to put out third seed Pen-Ek Karaket of Thailand.
However, the 20-year-old could not make up the deficit in the final and was caught by another big head shot in the last round as Bonilla delivered Spain's first taste of Olympic Taekwondo gold with a 17-8 victory.
Bonilla, 22, admitted he had pushed himself to the limit to become Olympic champion.
'I have been through so much hard work to reach this gold, so much support, but also so much pain, but in the end it all paid off,' he said.
'We (Spain) have never managed to get gold in Taekwondo until now, so I am so glad and it's so great to be the first one.
'I hope that I get something more in the future.'
Bronze went to beaten semi-finalist Russian Alexey Denisenko after he overcame repechage winner Safwan Khalil of Australia.
Colombian 19-year-old Oscar Munoz Oveido also claimed bronze after he saw off Karaket - who had what would have been a winning head kick at the buzzer correctly overturned by video review.