I was under the impression that bikes have a minimum weight in the rules and actual bikes are pretty much always under that weight these days? They then add little lead weights in strategic places the get them to the minimum weight (and help improve balance by placing the weights in the right spots). I'm not sure of the average added weight is, but you'd think it would at least negate some of the weight of the motor/battery (ie: the motor+battery weights 800g but there's 500g of extra average weight added to a bike, so they would only have a +300g bike..)
Note: I know pretty much nothing about racing but I have had that idea in my head for a while about the added weight. Maybe from a friend who told me his bike wasn't UCI compliant because it weighed too little?
Supporting what you're saying, it's not hard to find bikes that are under the UCI rules. For example, the Specialized Aethos often comes in at less than the required minimum weight.
But for a TT bike and such as upthread... Or anything where it's not mostly about climbing... Weight is a less important factor than aerodynamics, by far.
I personally think that the whole "motor doping" thing in the pro peloton (ie races like the TdF) is a contrived boogeyman. Unlike drug doping, which could happen with just one or two people besides the athlete, a modified bike would take a bunch of folks to know about it and keep quiet, which is notoriously a problem and would likely leak out.
You'd need the person or folks who modified the frame, the mechanics, the riders, the folks swapping the bikes out pre-inspection, the folks destroying the bikes, and then the litany of people who look over bike and rider photos and video for any little thing (odd buttons, pressing unexpected things at just the right times, etc).
Note: I know pretty much nothing about racing but I have had that idea in my head for a while about the added weight. Maybe from a friend who told me his bike wasn't UCI compliant because it weighed too little?