I think that Eri has no reason to behave the way she does for few reasons.
1.Tenma doesn't flirt with Harima, but is just being friendly with him (has no romantic intrest)
2.Eri is not dating Harima and has no say to his doings, and thus has no right to feel angry at Tenma for "interfering" in their "relationship" which is non-existant at the moment
3.Just because she has addmitted to herself that she loves Harima her public opinion is still "I hate hige" so how is Tenma supposed to know her true feelings?Not to mention that Harima has declared to Tenma that Eri is just in his way
4.Eri knows that Tenma loves Karasuma
So she is just behaving like a jealous little brat and Tenma has no real reason to be the target of her feelings of inferiority.Tenma has no reason to apologise to her but she has a rather large reason to do so to Tenma.