No system is ever created perfect, and such vulnerabilities and flaws exist. Bitcoin is also not perfect; you can create double spend tx given the right condition, create a 51% attack that would fork the whole chain and create confusion among others. It's just that there aren't sufficient time, resources and efforts for these attacks to be sustained or prolong that can damage the whole network.