Are SMD components sometimes glued?
There are SMT unit process steps that use a wave solder machine to attach smaller (with isolated and separate leads) SMT components like resistors and capacitors.  The device is glued down on the side where the wave will flow and when the PTH components are soldered the wave covers and solders the SMT devices. The devices are glued down as the board side that is being soldered is facing down.

Some manufacturers also glue down components that may shift during reflow soldering (like the case in your picture) especially if the component needs registration or alignment is critical and the part should not move during attachment.