mate, based on your interesting feedback i googled it and found many
others have had similar experiences on various different bikes..
consensus seems to be that securing it with rubber seems to help,
but best result apparently is to wrap it in insulating foam first
then secure it well using rubber etc..
also raised is adding oil inside the sensor itself to allow the ball
to move [thus sense tilt etc] but to not make the typical 'rattle'..
choices of response interesting, large goldwing owners tend to
want to keep the sensor, but attempt to stop its noise,
whereas 600rr owners want to switch it off variously,
to avoid it sensing deep lean angles and switching off
while mid corner [!] esp those racing their 600rr..
going by the terminology used my others of 'rattling' seems
you may have discovered the 'upper fairing rattle'