"...by law..."
Law is a function of location. Various locations will have widely differing rate tariffs (especially regarding how much they'll pay for consumer generated power [less, net, generous]).
With a modest solar panel installation and a normal (Westernized) lifestyle, one might never produce enough power to exceed one's own power requirements. The meter would always spin forward, just a bit slower.
Of course, if one has a multi-kw installation, hopefully the resultant shadow doesn't cause the electric heating bill to rise.