This is perhaps a normative or moral question rather than one of historical analysis. As a personal matter I do not consider it to have been a legitimate government in any way, shape, or form. However, it did have some of the trappings of a nation; certainly it had an elected government, and exerted authority over the territory it controlled. As several answers in the FAQ cover, though, the historical consensus is that secession could not make a legitimate government by the rules of the United States at that time.
I want to return to the question of moral vs historical analysis, though. There is a school of historical thought (exemplified quite eloquently in, for instance, many of our own /u/commiespaceinvader's old Monday Methods posts^(†)) that says that history is not very good history if it sweeps the experiences of the weakest & often most voiceless members of a society under the rug. By considering the Confederacy a legitimate government, we are to some extent prioritizing the most powerful members of that society's definitions of legitimacy over the weakest. From the perspective of an enslaved person, the Confederacy is most certainly not a legitimate government.
† For instance: We talk about actual human beings and "get your feels out of history" is wrong – on Empathy as the central skill of historians and "Not the mere accumulation of knowledge but the emancipation of man from slavery": The Frankfurt School, Critical Theory, and critical theory