I have a 20 amp circuit in my home (the breaker is 20 amps). On that circuit there is a light switch rated for 15 amps that controls three 15 amp receptacles.
Is the 15 amp switch ok, or should it be a 20 amp light switch?
Dean MacGregor is correct.
Here is the pertinent National Electrical Code Article.
Article 404.14(F) Cord- and Plug-Connected Loads. Where a snap switch or control device is used to control cord- and plug-connected equipment on a general-purpose branch circuit, each snap switch or control device controlling receptacle outlets or cord connectors that are supplied by permanently connected cord pendants shall be rated at not less than the rating of the maximum permitted ampere rating or setting of the overcurrent device protecting the receptacles or cord connectors, as provided in 210.21(B).
So, basically the switch needs to be a 20 amp switch for multiple receptacles on a 20 amp circuit.
In theory it's fine as long as the combined draw of the 3 receptacles never goes above 15amps. Of course since you won't really know whether or not that is the case, what happens if you accidently do draw more than the 15 amps on those 3 outlets? Well, the breaker won't trip (unless you go over 20 as well) because it's a 20amp breaker so the switch will be overloaded and could heat up and start a fire.
TLDR: no not ok.
Short answer: No, it is not good at all. Any protection shall break first with large enough margin, no matter what and how it protects. Fuse, breaker, torque limitter,...
Fuses and breakers shall be the weakest points in the circuit, because they are designed to "fail" safely. 15A switch will burn without 20A fuse ever noticing it. They must break first to protect the rest. If they don't, they are no more a protection.
If you want to use 15A switch you have to protect it with at most 15A rated fuse/breaker. In other words, you have to create sub-circuit with lower rating and appropriate protection.