I wasn’t fond of Foggy initially either. He really had “sidekick/comic relief” printed on his forehead, being (seemingly) less skilled as a lawyer AND less handsome AND not a super-hero. But he has an arc, and season 2 has him step out of Matt’s shadow and realize that he’s not as dependent on him as he thought.
And he’s right to call Matt on his shit, right to be pissed about Matt being unreliable and not letting him know about what was going on. Is he worried about Matt getting hurt? Of course he is. As any close friend would. IMO the reason he gets frustrated though is him feeling that Matt is not invested in their friendship as he is; not trusting him (Foggy) and telling him what’s going on.