As long ago as the 1300s, 'tidy' was used as an indefinite epithet meaning 'good, excellent' etc. More recently - particularly around Dickens' time - it came to be used to mean 'considerable' as in 'a tidy pace', 'a tidy tip' and 'a tidy penny' etc. Hence, 'a tidy profit' today.