*nerd glasses*
Federation credits are mainly for trading with civilizations outside of the Federation (like the Ferengi). Within the Federation, there's no need for money because replicators meet nearly every need. Other civilizations have replicators as well, but they stick to capitalist practices mainly out of cultural tradition (again, like the Ferengi). But Earth (and later the Federation--although I believe the Vulcans were also a money-free society at the time of First Contact) abandoned currency after the Bell Riots in 2024 caused Earth's population as a whole to rethink the social problems it had dealt with for centuries (namely, inequality).