Moses is the soul shaped toward being born perfect, not yet delivered into that fullness, and his sleeping with his fathers is that stage passing so the next may come. The strange gods a person chases are every power he credits outside himself: luck, circumstance, another's approval, anything he treats as the source of his life. To go after them is to forget that his own awareness of being, the I AM in him, is the only cause.
That forgetting is the one betrayal, and it is what breaks the covenant. Evil here is not misconduct. It is turning to an outer god instead of the power within. A person plays the harlot the instant he hands his fate to something he thinks stands over him. The one he abandons when he does this is himself.