hi Rose,
the word "serve" can have lots of definition in tagalog and likewise, "serve it right" may be an idiom.
do you have the complete english sentence (if there is) where you found this phrase?
as an idiom, it may mean "ibigay ang nararapat para dito."
:)