The sale of goods act gives SIX MONTHS warranty on any car whether new or s/h, that is the law.
It does not cover minor things, or consumables tyres/wipers/pads etc, but covers any major fault for 6 months, regardless of what lies the dealer may tell you.
In this case, you are certainly entitled to a correct fitting master key, as presumably this would be needed to programme subsequent keys anyway ?
More to the point someone else has the master key to your car, that would concern me more, old master key can be deleted from system and new one cut and programmed in, then let them sort the features on the alarm as well.
tabetha