Bridging Neutral and ground in a Light Switch
That's actually terrible.  You bootlegged neutral and that is something you should not do anywhere.  

It would have been much wiser to choose a switch that requires neutral since you do indeed have neutral in that box.  I gather at the time you bought the switch, you didn't know that.  

Most likely what is happening is the switch is a smart switch which requires neutral to power its internal electronics. And either a) this is cheap Cheese junk direct shipped from Shenzhen (possibly via an Amazon Fulfillment Center) that has never received a bona-fide UL listing and is not safe, or is one of the cases where UL authorized use of the ground to serve the part of neutral.  The latter is done so the switch will work in locations that do have ground but don't have neutral.  NFPA has told them to stop approving that. 

So, ironically, you have done an unauthorized bootleg of an authorized bootleg, bringing it full circle, right back to manufacturer intent.  So what's the problem?  The problem is Neutral still is not Ground.  If this neutral wire has a problem, it is a guarantee that the grounded parts of this switch (like the cover screws) will be energized at 120V.  Now we hope the UL listing was predicated on the idea that the switch can't leak enough current to kill anyone.  We hope.  

My recommendation would be to remove this switch, reuse it somewhere else you have ground but not neutral (assuming it is not mail-order rubbish), and fit a "neutral required, ground not required" switch here.