People who attack emergency services are not getting harsh sentences despite a new law, an MP says.