Bastard, meaning one begotten and born out of wedlock, is a very old word from Old French (earliest OED citation 1297).
Dastard, meaning one who meanly or basely shrinks from danger; a mean, base, or despicable coward; one who does malicious acts in a cowardly, skulking way, so as not to expose himself to risk, appears to be of English formation and dates from the 15th century onwards (OED).
In the course of the 19th century a useful and idiomatic word, dastard, stopped being used at all (even though its adjectival form, dastardly, lives on (e.g. Whacky Races). During the 1800s all the sense of dastard, including especially it's use as a term of abuse, was subsumed under a similar-sounding word (bastard), whose abusive power until that point had been limited to implying a person was a mongrel, and an (animal of) inferior breed (OED).
This Ngram suggests that the decisive rise of bastard and decline of dastard occurred in the years following the First World War... Is there any specific reason why bastard became so popular and why dastard fell so completely out of use?