Blame Gene Roddenberry for making the writers work around an untenable premise: an action sci-fi series with families in tow. Captain Picard was gathering data in an unexplored area of space, which is his job AND is just the thing he loves to do. In the second example, the Prime Directive was not violated as long as the observers stayed hidden. You can argue that risking detection was stupid and a de facto violation for taking such a risk, but a scientific agency making a bad decision isn't exactly unheard of.
_________________
Everything would be better if you were in charge.