Diarrhea in alpacas is a clinically significant condition and the primary cause of morbidity in neonatal Peruvian alpacas. This study aimed to correlate early diarrhea in crias of alpaca with changes in the microbiota community. A total of 19 alpacas (aged 1–2 months) were collected, including nine with a health condition and ten healthy ones. Fecal samples were obtained under sterile conditions and their DNA was extracted. Sequencing of the V3-V4 region of the 16S rRNA gene was conducted in the Illumina platform, followed by bioinformatics analysis. Reduced microbial diversity was evident in alpacas afflicted with diarrhea, delineating contrasting microbial compositions in comparison to their healthy counterparts. The study characterized the predominant bacterial classes and phyla within the gut microbiota, with Firmicutes, Verrucomicrobiota, and Bacteroidota collectively constituting approximately 80% of the total bacterial population. Substantial disparities in these microbial compositions were observed between the two groups, a variance that appeared to be influenced by both age and the health status of the alpacas. The bacterial class Verrucomicrobiae exhibited a significant presence within the group of alpacas suffering from illness. Furthermore, specific pathogenic species such as Clostridium spiroforme, Blautia, and Bacteroides fragilis were detected in significantly higher proportions among the afflicted alpacas. The functional diversity across the two groups was also found to be markedly different, a distinction that is graphically represented in a heat map illustrating the fifty principal differential KEGGs. This study provides valuable insights into the role of gut microbiota in alpaca health and may have implications for veterinary care and management.