Sorcerer: Add +1/4 to the sorcerer’s caster level when casting spells with the good descriptor.
Since the text states "sorcerer's caster level," it would be limited to sorcerer spells. Spells from a different class do not use the sorcerer caster level to determine effects.
If the text had stated "[aasimar's or character's] caster level" or "Whenever you cast a spell with the good descriptor,"* then it would apply to any spell.
*- such as the text for many of the sorcerer bloodline arcana
Can a favored class bonus from one class be applied to another class? For example the Aasimar FCB for sorcerer is a bonus to caster level for good spells. If the character has levels in another class like cleric can they use that bonus when casting good cleric spells?
Much as I wish I could tell you something else, the answer is going to be "it depends."
Expanding on what Dragonchess Player said:
To be precise, it depends on whether the FCB refers to the class granting it. In your example the bonus would not apply to cleric spells because the Aasimar sorcerer FCB is
Add +1/4 to the sorcerer’s caster level when casting spells with the good descriptor.
However the undine's favored class bonus would apply to other classes' spells. Because it doesn't specifically refer to sorcerer spells.
Add a +1 bonus on caster level checks to cast spells underwater.
It would be cleaner if everything was limited to the class that granted the ability. But we've got ample developer clarifications that the above is true. Like how the elemental bloodline arcana damage bonus applies to spells from any class.