Foundation modal in wordpress php loop

first, read this about query_posts.

to answer your question-

has_post_thumbnail() returns true or false, iterating over that in a foreach loop isn’t possible.

I’ll guess that the reason why the same modal appears to be repeated is that you’re giving them all the same id, so the first one is always opened. Use the post’s ID to make those unique to each post.

if (has_post_thumbnail() ) {
    echo '<li><a href="#" class="photo" data-reveal-id="myModal' . get_the_ID() . '"></a></li>';
    echo '<div id="myModal' . get_the_ID() . '">' . get_the_post_thumbnail() . '</div>';
}