The FLAG_ACTIVITY_NEW_TASK places your new activity on a new task stack. I'm going to refer to the activities as A and B.
When you launch the first app, you have a single task with A in it. Task 1 = A
Clicking on the second activity puts B in the task. Task 1 = AB
When you click home you preserve the task. Task 1 = AB (still)
Opening the second app and send the A intent with the new task flag a NEW task will be created with only A on it. Now you have two tasks. Task 1 = AB, Task 2 = A
Unwrapping this arrangement with the back key will result in 2A, 1B, 1A which is what you are seeing. This is the expected result.