why does the butterfly change its spots?

Because it is so inclined! (A cline being a gradation in one or more characteristics within a species, especially between different populations).

Thus this woodland loving butterfly, common enough throughout much of the UK, appears dark brown with orange spots in the southerly regions as opposed to the white spotted sub-species here in the more Northerly climes of South Yorkshire.

Further reading
UK Butterflies – the Speckled Wood