No, it is actually both things. The sugar causes people to eat the stuff and does contribute to obesity, but sugar is only a contributer. The additives and ingredients like vegetable oils (which cause health problems of their own due to their chemical structure) also contain a lot of calories (fat contains more calories per gram than sugar).
In Australia obesity increased while sugar consumption decreased. The additives really matter and have a huge impact on human health--they are not a rounding error, but it was a great marketing tactic on behalf of various food industry groups to vilify sugar while deflecting from the other ingredients that are similarly problematic.