WP text editor change html markup

WP is removing things like data-slide-to="0' because it thinks it’s cleaning up your HTML for you. Whenever you have somewhat custom HTML like this, use a shortcode instead. You happen to be in luck – there’s already a plugin that creates the shortcode for you.

If you don’t want to use a plugin, and you are using a custom theme or a custom child theme already, you could review the code in the plugin and build something similar into your theme.