There's a video I was watching that was going through comments and debunking excuses about why the South actually seceded and making it pretty clear it all comes back to slavery, and there was a part where he addressed a myth I learned about in high school it wasn't the case that the North disliked slavery because they were actually these moral people with a more modern sense of race relations and actually they were many of them racists themselves and white supremacists, however while he doesn't go into detail the video maker claims that later on in the war when many of these Northern boys who might not have ever seen a black person before are starting to march around the heartland of plantation country seeing what slavery is actually like and interacting with black people more and more as these armies of former slaves start following the Union armies for lack of anything better to do they opinion of slavery started to more resemble a more modern "this is evil and should not be allowed" view. Is this true?
Short answer, yes, evidence indicates that support for emancipation increased in union soldiers the more they were exposed to the treatment of slaves in the south.
Excellent related write up to the causes of the war stemming from slavery by u/Georgy_K_Zhukov - https://www.reddit.com/r/AskHistorians/comments/3edss0/comment/cte2mj9
To add some specifically to your question, a big part of the problem with questions on the civil war (and history in general) is presumption of fact in the question itself. For instance, and I really don't mean to pick on you, but the North did not have a singular opinion. A better way to examine it would be by political affiliation popularity in a region, but even then - particularly in the 1850s - there was difference of opinion within the parties.
Another flaw is the common conception that racist=pro slave, which is not true. Even Lincoln, the champion of the abolition party Republicans, said he didnt think whites and blacks should marry or that blacks were equal to whites. He didn't think they should sit on juries or hold office. This, in his opinon, did not prevent their rights as humans to liberty and pursuit of happiness. He felt the larger issue was the legal capability (or lack of) for the South to withdraw from the Constitution, splitting the Union. There was a "Copperhead" political movement in the north as well, supporting the South and blaming the war on abolitionist republicans. Their counter was war democrats, northern dems that supported war to maintain the Union but otherwise generally holding state authority beliefs.
As the war went on, more and more individuals supported the ideals of the Republicans. When the war started there were multiple slave states remaining in the Union. Some, like W Virginia, acted to end slavery on their own. Union General Grant had his wife Julia and her slave Jules in his HQ camp. After the Emancipation Proclamation, she stayed as a paid helper for some time before venturing off on her own (while returning to Missouri would have allowed Julia to retain her longer). There are numerous letters home that give an idea to the root of your question about rank and file soldiers and in '64 and '65 many historians acknowledge there was an increase in comments on slavery as a cause and/or curse to be stopped and decrease in those on constitutional preservation or duty to country, indicating the more exposure the troops had the more they supported abolition. In that time Sherman would sit in Savannah with the local black clergymen and community leaders. His 40 acre plan to confiscate coastal Georgia and start a black state resulted from the input of those leaders after indicating that would allow them the best future (I like to "what if?" about that land running up the Savannah River on the S.C./GA border instead and actually happening).
By the end of the war the North, still largely racist, supported emancipation generally speaking and including in the army ranks (there had been some minor instances of backlash/frustration by union soldiers immediately after the E.P. since they had enlisted to preserve the union). Copperheads disappeared after the Atlanta campaign. It was after this that interpretations came more into play. The black communities largely saw emancipation as an ongoing effort while whites largely saw it largely as the passage of the 13th and 14th amendments. Some Union soldiers returned home having supported emancipation only to then support segregation. After the war the radical republicans take charge and by 1872 there are three big players politically, the Bourbon Democrats (old mentality democrats that would go on to write Jim Crow), the Radical Republicans, and the Liberal Republicans, with the last two both supporting enfranchisement of minorities.