Ouch, man, that is kinda sad. Seeing one of your good friends explode right in front of you? Sad indeed, but, awesome picture! I love his desperate yet shocked expression, and the way Tommy's transparent in the sky.
It's a long confusing story haha XD; Basically there are these little nanites that Tommy could control and command them to do as he wishes (nanites are like little microscopic robots, and they bonded onto his shell). Eggman's computer sonic A.D.A.M. however took over and controlled the nanites and Tommy, aaaand things started getting hectic (A.D.A.M. is taking over everything robotic in both Robotropolis and Knothole. This is also against Eggman's wishes and was surprised his son turned against him. While Super Sonic and Super A.D.A.M./Tommy were fighting, Tommy regained control briefly and apologizes for all the trouble he caused and thanks Sonic for giving him a second chance in life (Tommy has "died" multiple times in the past). Tommy then flew into Eggman's Egg Fleet and got fired upon, killing him and A.D.A.M. for good.