A machine that flies like a bird is called an [Ornithopter](https://en.wikipedia.org/wiki/Ornithopter), and they already exist.
As to why they aren’t used more often? They add way to much complexity, and are way less efficient than fixed wing aircraft. As others have noted, many larger birds actually emulate fixed winged aircraft when gliding, as they use thermal air currents to fly for extended periods without flapping their wings, as flapping their wings uses way more energy.
Latest Answers