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).