Translated articles and indexing

I have about 4000 articles on my blog;
2000 Italian and 2000 translated into Spanish

in each Italian article, I have added the corresponding hreflang to the article translated into Spanish in “code injection”, for example:

<link rel='alternate' hreflang='es'

the result is the following in google search console:
2400 pages indexed correctly (those in Italian)

In excluded pages:

"Alternative page with appropriate canonical tag (2305)": these are only AMP articles but with a mixture of Italian and Spanish pages

"Pages with redirection (2160)": there is a mixture of Italian and Spanish non-AMP pages.

I don’t understand why all Italian and Spanish pages shouldn’t be indexed.
Is hreflang revealed by google as canonical?

Furthermore, Italian pages should not be detected as “redirected and non-indexed pages”

Did I do something wrong?

Hreflang and canonical tags have different purposes.
Hreflang tags make sure the right version of the page is showed to users depending on their location (spanish version to spanish people), while canonicals make sure that in case there are duplicates of a page, they point to the main page worthy of being indexed.

If you haven’t set up canonical tags correctly, it’s Google that decides which pages are worth of being indexed. Maybe this is what happened to your websites.
I would also make sure that both spanish and italian pages have the “index” metatags.

If you want to have a deeper understanding of how canonical and hreflang tags work together, I suggest you to read this article from Scandiweb. It really helped me when I first approached International SEO.

Thanks for the info.

At the moment the google search console, which I haven’t visited in a while, says I have 5200 unindexed and 2200 indexed pages.
This is strange as I don’t have that many pages on my site. I should have about 4000 in total.

However in a nutshell my site presents a series of articles in two different languages. My aim is clearly to index as many articles as possible in both languages.

While the articles in the secondary language have nothing injected

Articles in the main language currently have a link like this:

<link rel = 'alternate' hreflang = 'es'
        href = 'https: //'/

I think I have to remove these links to allow google to affect everything