Why would a journal accept my previous paper for publication, but reject latest manuscript due to being "outside of the journal's scope?"
Four ideas: 


It was really out of scope last time, but they either


didn't notice and mistakenly accepted it, or
didn't have enough in-scope papers to fill the issue, so they accepted yours even though it was slightly out of scope.

They made a mistake and your new paper is actually in-scope. However, you won't win any friends or improve your chances by trying to convince them of this. 
The journal has changed scope slightly in the last year, or is trying to change scope slightly now, or different editors have different ideas of what the scope is (as suggested by NateEldredge)
There was some small detail about the first paper that made it in-scope which the second paper lacks, which we couldn't possibly identify for you.