When a switch statement jumps to the matching case, it runs that code and then continues (over all following cases) until it either reaches the ending brace of the switch, or it hits a break keyword.
So when MouseButtonPressed is detected, the MouseButtonReleased will also run because it's next in line.
Change the code to:
switch (e.type) {
case sf::Event::Closed:
win.close();
break;
case sf::Event::MouseButtonPressed:
std::cout << "mouse button pressed\n";
break;
case sf::Event::MouseButtonReleased:
std::cout << "mouse button released\n";
}