It wasn't "made to be" flexible and modifiable, being flexible and modifiable is just a result of the natural properties of these molecules.The 4 nitrogen bases types for the DNA are Adenine, thymine, guanine and cytosine.
The order of these 4 types is what makes the genetic code, how it was made to be flexible and modifiable.