It sounds like in your example some of the yellow flowers carry a recessive copy of the allele for the red color. Take the following case. Lets assume that small f is the allele for red flow color and big F is the for yellow flower color
If you cross these flower types you can get several different variations
ff crossed with ff will always give you red flowers. This is why crossing a red flower with another red flower in this example will always produced a red flower.
since there is no big F you will get red flowers 100% of the time.
on the other hand if you cross a red flower ff with a yellow flower FF you get
Since the big F is dominant all of these flowers will be yellow
In another example, if you cross a ff and a Ff you would get
This means you would get 75% red flowers and 25% yellow flowers even though you are crossing a yellow flower with a red flower.
Hope that helps.